diff options
author | dundargoc <gocdundar@gmail.com> | 2024-07-21 14:55:34 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-07-21 15:39:47 +0200 |
commit | 4c788b175743e54d0a73248c820d6cf16a854f6e (patch) | |
tree | 32d484aeaeeac4b94ed448eb56bb89d0729131a1 | |
parent | e1b7fa2a3a2ad6e91128e20203e226200d9d9bef (diff) | |
download | rneovim-4c788b175743e54d0a73248c820d6cf16a854f6e.tar.gz rneovim-4c788b175743e54d0a73248c820d6cf16a854f6e.tar.bz2 rneovim-4c788b175743e54d0a73248c820d6cf16a854f6e.zip |
ci: always add `target:release` label when backporting
Previously the label was not added if the backport PR was created
manually. The new code is also easier to maintain as it's close to other
label-related code.
-rw-r--r-- | .github/workflows/backport.yml | 11 | ||||
-rw-r--r-- | .github/workflows/labeler_pr.yml | 19 |
2 files changed, 18 insertions, 12 deletions
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index de62ffb59d..0c3ba6be34 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -26,14 +26,3 @@ jobs: pull_title: "${pull_title}" label_pattern: "^ci:backport ([^ ]+)$" github_token: ${{ steps.app-token.outputs.token }} - - - if: ${{steps.backport.outputs.was_successful == 'true'}} - uses: actions/github-script@v7 - with: - script: | - github.rest.issues.addLabels({ - issue_number: ${{steps.backport.outputs.created_pull_numbers}}, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['target:release'] - }) diff --git a/.github/workflows/labeler_pr.yml b/.github/workflows/labeler_pr.yml index 8fd93bfb6d..5d402c3c03 100644 --- a/.github/workflows/labeler_pr.yml +++ b/.github/workflows/labeler_pr.yml @@ -33,8 +33,25 @@ jobs: - name: "Extract if the PR is a breaking change and add it as label" run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true - request-reviewer: + target-release: needs: ["changed-files", "type-scope"] + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - if: startsWith(github.base_ref, 'release') + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['target:release'] + }) + + request-reviewer: + needs: ["changed-files", "type-scope", "target-release"] permissions: pull-requests: write uses: ./.github/workflows/reviewers_add.yml |