Skip to content
Snippets Groups Projects
Unverified Commit d887804b authored by Oliver Tale-Yazdi's avatar Oliver Tale-Yazdi Committed by GitHub
Browse files

[Bot] Use correct token in backport bot (#5654)


The backport bot does currently not trigger the CI when opening a MR,
like here: https://github.com/paritytech/polkadot-sdk/pull/5651
Devs need to push an empty commit manually. Now using a token that will
also trigger the CI.

---------

Signed-off-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
parent 9079f36b
No related merge requests found
Pipeline #496431 waiting for manual action with stages
in 37 minutes and 7 seconds
......@@ -27,15 +27,24 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.CMD_BOT_APP_ID }}
private_key: ${{ secrets.CMD_BOT_APP_KEY }}
- name: Create backport pull requests
uses: korthout/backport-action@v3
id: backport
with:
target_branches: stable2407 stable2409
merge_commits: skip
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ steps.generate_token.outputs.token }}
pull_description: |
Backport #${pull_number} into `${target_branch}` (cc @${pull_author}).
Backport #${pull_number} into `${target_branch}` from ${pull_author}.
See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot.
<!--
# To be used by other automation, do not modify:
......@@ -47,6 +56,7 @@ jobs:
{
"conflict_resolution": "draft_commit_conflicts"
}
copy_assignees: true
- name: Label Backports
if: ${{ steps.backport.outputs.created_pull_numbers != '' }}
......@@ -64,3 +74,21 @@ jobs:
});
console.log(`Added A3-backport label to PR #${pullNumber}`);
}
- name: Request Review
if: ${{ steps.backport.outputs.created_pull_numbers != '' }}
uses: actions/github-script@v7
with:
script: |
const pullNumbers = '${{ steps.backport.outputs.created_pull_numbers }}'.split(' ');
const reviewer = '${{ github.event.pull_request.user.login }}';
for (const pullNumber of pullNumbers) {
await github.pulls.createReviewRequest({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: parseInt(pullNumber),
reviewers: [ reviewer ]
});
console.log(`Requested review from ${reviewer} for PR #${pullNumber}`);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment