forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bot] Use correct token in backport bot (paritytech#5654)
The backport bot does currently not trigger the CI when opening a MR, like here: paritytech#5651 Devs need to push an empty commit manually. Now using a token that will also trigger the CI. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
- Loading branch information
Showing
1 changed file
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,15 +27,24 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate token | ||
id: generate_token | ||
uses: tibdex/[email protected] | ||
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}`); | ||
} |