From f6dbc71b0de6c740288a5ef3f26586ee31a76d0a Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Wed, 4 Dec 2024 14:11:03 +0100 Subject: [PATCH 1/3] change action that generates token woth more permissions --- .github/workflows/command-backport.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/command-backport.yml b/.github/workflows/command-backport.yml index eecf0ac72d2c..cb1966ee3ff7 100644 --- a/.github/workflows/command-backport.yml +++ b/.github/workflows/command-backport.yml @@ -29,12 +29,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Generate token - id: generate_token - uses: tibdex/github-app-token@v2.1.0 + - name: Generate content write token for the release automation + id: generate_write_token + uses: actions/create-github-app-token@v1 with: - app_id: ${{ secrets.CMD_BOT_APP_ID }} - private_key: ${{ secrets.CMD_BOT_APP_KEY }} + app-id: ${{ vars.RELEASE_AUTOMATION_APP_ID }} + private-key: ${{ secrets.RELEASE_AUTOMATION_APP_PRIVATE_KEY }} + owner: paritytech - name: Create backport pull requests uses: korthout/backport-action@v3 @@ -42,7 +43,7 @@ jobs: with: target_branches: stable2407 stable2409 stable2412 merge_commits: skip - github_token: ${{ steps.generate_token.outputs.token }} + github_token: ${{ steps.generate_write_token.outputs.token }} pull_description: | Backport #${pull_number} into `${target_branch}` from ${pull_author}. From 1d712bf9aff6783680294ab53598fa6bee9f87f4 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Wed, 4 Dec 2024 15:45:13 +0100 Subject: [PATCH 2/3] change request reviewrs method --- .github/workflows/command-backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/command-backport.yml b/.github/workflows/command-backport.yml index cb1966ee3ff7..53dcea2f1d6d 100644 --- a/.github/workflows/command-backport.yml +++ b/.github/workflows/command-backport.yml @@ -87,7 +87,7 @@ jobs: const reviewer = '${{ github.event.pull_request.user.login }}'; for (const pullNumber of pullNumbers) { - await github.pulls.createReviewRequest({ + await github.pulls.requestReviewers({ owner: context.repo.owner, repo: context.repo.repo, pull_number: parseInt(pullNumber), From 5595716ccd87073e1ee54eeb694fd48680ea15ab Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Wed, 4 Dec 2024 23:12:46 +0100 Subject: [PATCH 3/3] add release env to the backport job --- .github/workflows/command-backport.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/command-backport.yml b/.github/workflows/command-backport.yml index 53dcea2f1d6d..db006e9bd907 100644 --- a/.github/workflows/command-backport.yml +++ b/.github/workflows/command-backport.yml @@ -16,6 +16,7 @@ jobs: backport: name: Backport pull request runs-on: ubuntu-latest + environment: release # The 'github.event.pull_request.merged' ensures that it got into master: if: >