Update onpr_automerge.yaml

This commit is contained in:
Alexandre
2024-06-17 13:43:34 +02:00
committed by GitHub
parent f3b51997db
commit 3bdc079cde

View File

@@ -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