Skip to content

Commit

Permalink
ci: remove SUPPORT_TOKEN and use create-github-app-token (#1509)
Browse files Browse the repository at this point in the history
  • Loading branch information
lauramargar authored Jun 10, 2024
1 parent cc6518e commit a03fe4b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ jobs:
runs-on: ubuntu-latest

steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- name: checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -34,4 +42,4 @@ jobs:
uses: ./.github/actions/release-alpha
with:
npm_token: ${{ secrets.NPM_TOKEN_GRANULAR_ACCESS }}
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
10 changes: 9 additions & 1 deletion .github/workflows/edocs-dynamic-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ jobs:
connect-with-edocs:
runs-on: ubuntu-latest
steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- name: Checkout X mono-repo
uses: actions/checkout@v4
with:
Expand All @@ -23,5 +31,5 @@ jobs:
--url https://api.github.com/repos/empathyco/docs-framework/actions/workflows/93444504/dispatches \
--data '{"ref": "main", "inputs": {"branchName": "${{ env.BRANCH_NAME }}", "version": "${{ steps.package-version.outputs.current-version }}"}}'
env:
GITHUB_TOKEN: ${{ secrets.SUPPORT_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

10 changes: 9 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ jobs:
options: --user 1001

steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -51,6 +59,6 @@ jobs:
- name: push tags
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}
branch: ${{ github.ref }}
tags: true
10 changes: 9 additions & 1 deletion .github/workflows/release-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ jobs:
options: --user 1001

steps:
# Use GitHub App token as a workaround to allow bypassing branch-protection rules
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_TOKENS_APP_ID }}
private-key: ${{ secrets.GH_TOKENS_APP_PRIVATE_KEY }}

- name: checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -28,4 +36,4 @@ jobs:
uses: ./.github/actions/release-alpha
with:
npm_token: ${{ secrets.NPM_TOKEN_GRANULAR_ACCESS }}
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ steps.app-token.outputs.token }}

0 comments on commit a03fe4b

Please sign in to comment.