Skip to content

Commit b36d131

Browse files
authored
Use the pull request bot instead of default token (#535)
* Use the pull request bot instead of default token When using the default github.token pull requests will not automatically trigger workflow checks to run (to avoid recursion problems) so we need to use another token to rebase the pull requests. Since we are already using the etos pull request app to create the pull requests we might as well use it to rebase them.
1 parent 80c7b35 commit b36d131

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/rebase-automatic-prs.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,27 @@ jobs:
1616
rebase:
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: Generate a token
20+
id: generate-token
21+
uses: actions/create-github-app-token@v2
22+
with:
23+
owner: ${{ github.repository_owner }}
24+
repositories: etos
25+
app-id: ${{ vars.ETOS_PR_APP_ID }}
26+
private-key: ${{ secrets.ETOS_PR_APP_PRIVATE_KEY }}
1927
- name: Checkout
2028
uses: actions/checkout@v6
29+
with:
30+
repository: ${{ github.repository }}
31+
token: ${{ steps.generate-token.outputs.token }}
2132
- name: Set rebase labels
2233
run: python ${GITHUB_WORKSPACE}/scripts/rebase_labels.py check ${{ github.repository }} ${{ env.LABEL }}
2334
env:
24-
GH_TOKEN: ${{ github.token }}
35+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
2536
- uses: peter-evans/rebase@v4
2637
with:
2738
base: main
39+
token: ${{ steps.generate-token.outputs.token }}
2840
# Only include PRs that were automatically created by ETOS
2941
include-labels: |
3042
${{ env.LABEL }}
@@ -38,4 +50,4 @@ jobs:
3850
if: always()
3951
run: python ${GITHUB_WORKSPACE}/scripts/rebase_labels.py cleanup ${{ github.repository }} ${{ env.LABEL }}
4052
env:
41-
GH_TOKEN: ${{ github.token }}
53+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}

0 commit comments

Comments
 (0)