From 3b400ae63e488b94999a95d4282b87e5a07325bf Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:55:21 +0100 Subject: [PATCH] Update onpr_automerge.yaml --- .github/workflows/onpr_automerge.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/onpr_automerge.yaml b/.github/workflows/onpr_automerge.yaml index 8a52d1867..6cdc55ad4 100644 --- a/.github/workflows/onpr_automerge.yaml +++ b/.github/workflows/onpr_automerge.yaml @@ -21,9 +21,24 @@ on: - completed status: {} jobs: - automerge: - if: ${{ (github.event.issue.pull_request) && (contains(github.event.comment.body, '/automerge')) }} # <--- The other way to compare if it's on a PR or on an issue + labeler: runs-on: ubuntu-latest + steps: + - name: Add the automerge label + if: ${{ (github.event.issue.pull_request) && (contains(github.event.comment.body, '/automerge')) }} # <--- The other way to compare if it's on a PR or on an issue + uses: actions/github-script@v4 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['automerge'] + }) + automerge: + runs-on: ubuntu-latest + steps: - id: automerge name: automerge uses: "pascalgn/automerge-action@v0.16.2"