mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-12 02:21:28 +02:00
Update onpr_automerge.yaml
This commit is contained in:
33
.github/workflows/onpr_automerge.yaml
vendored
33
.github/workflows/onpr_automerge.yaml
vendored
@@ -1,26 +1,33 @@
|
|||||||
# yamllint disable rule:line-length
|
# yamllint disable rule:line-length
|
||||||
# shellcheck disable=SC2043
|
# shellcheck disable=SC2043
|
||||||
---
|
---
|
||||||
name: Automerge PRs
|
name: automerge
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issue_comment:
|
pull_request_review:
|
||||||
types:
|
types:
|
||||||
- created
|
- submitted
|
||||||
|
issue_comment:
|
||||||
|
types: created
|
||||||
|
check_suite:
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
status: {}
|
||||||
jobs:
|
jobs:
|
||||||
automerge:
|
labeler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if comment contains "/automerge"
|
- name: Add the automerge label
|
||||||
id: check_comment
|
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/automerge') }}
|
||||||
uses: actions/github-script@v5
|
uses: actions/github-script@v4
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
script: |
|
script: |
|
||||||
const comment = context.payload.comment.body;
|
github.issues.addLabels({
|
||||||
return { automerge: comment.includes('/automerge') };
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['automerge']
|
||||||
|
})
|
||||||
- name: Merge PR
|
- name: Merge PR
|
||||||
if: steps.check_comment.outputs.automerge
|
if: steps.check_comment.outputs.automerge
|
||||||
uses: actions/github-script@v5
|
uses: actions/github-script@v5
|
||||||
|
|||||||
Reference in New Issue
Block a user