Skip to content

Commit a3276e4

Browse files
authored
chore(ci): Use javascript-sdk-gitflow app instead of personal token (#18829)
Before submitting a pull request, please take a look at our [Contributing](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md) guidelines and verify: - [ ] If you've added code that should be tested, please add tests. - [ ] Ensure your code lints and the test suite passes (`yarn lint`) & (`yarn test`). - [ ] Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked. Closes #issue_link_here Closes #18830 (added automatically)
1 parent 6e42f4f commit a3276e4

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/external-contributors.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,17 @@ jobs:
3535
name: ${{ github.event.pull_request.user.login }}
3636
author_association: ${{ github.event.pull_request.author_association }}
3737

38+
- name: Generate GitHub App token
39+
id: app-token
40+
uses: actions/create-github-app-token@v1
41+
with:
42+
app-id: ${{ vars.GITFLOW_APP_ID }}
43+
private-key: ${{ secrets.GITFLOW_APP_PRIVATE_KEY }}
44+
3845
- name: Create PR with changes
3946
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
4047
with:
41-
# This token is scoped to Daniel Griesser
42-
# If we used the default GITHUB_TOKEN, the resulting PR would not trigger CI :(
43-
token: ${{ secrets.REPO_SCOPED_TOKEN }}
48+
token: ${{ steps.app-token.outputs.token }}
4449
commit-message: 'chore: Add external contributor to CHANGELOG.md'
4550
title: 'chore: Add external contributor to CHANGELOG.md'
4651
branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}'

.github/workflows/gitflow-sync-develop.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ jobs:
2525
- name: git checkout
2626
uses: actions/checkout@v6
2727

28+
- name: Generate GitHub App token
29+
id: app-token
30+
uses: actions/create-github-app-token@v1
31+
with:
32+
app-id: ${{ vars.GITFLOW_APP_ID }}
33+
private-key: ${{ secrets.GITFLOW_APP_PRIVATE_KEY }}
34+
2835
# https://github.com/marketplace/actions/github-pull-request-action
2936
- name: Create Pull Request
3037
id: open-pr
@@ -35,8 +42,7 @@ jobs:
3542
pr_title: '[Gitflow] Merge ${{ env.SOURCE_BRANCH }} into ${{ env.TARGET_BRANCH }}'
3643
pr_body: 'Merge ${{ env.SOURCE_BRANCH }} branch into ${{ env.TARGET_BRANCH }}'
3744
pr_label: 'Dev: Gitflow'
38-
# This token is scoped to Daniel Griesser
39-
github_token: ${{ secrets.REPO_SCOPED_TOKEN }}
45+
github_token: ${{ steps.app-token.outputs.token }}
4046

4147
- name: Enable automerge for PR
4248
if: steps.open-pr.outputs.pr_number != ''

0 commit comments

Comments
 (0)