-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ci): to use github app auth over long-lived credentials (#1838)
- Loading branch information
Showing
1 changed file
with
12 additions
and
5 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 |
---|---|---|
|
@@ -10,14 +10,21 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Get GitHub token via the CT Changesets App | ||
- name: Generate GitHub token (via CT Changesets App) | ||
id: generate_github_token | ||
uses: tibdex/[email protected] | ||
with: | ||
app_id: ${{ secrets.CT_CHANGESETS_APP_ID }} | ||
private_key: ${{ secrets.CT_CHANGESETS_APP_PEM }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# Pass a personal access token (using our `ct-release-bot` account) to be able to trigger | ||
# other workflows | ||
# Pass a personal access token (using our `ct-changesets` app) to be able to trigger other workflows | ||
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token | ||
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8 | ||
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
token: ${{ steps.generate_github_token.outputs.token }} | ||
|
||
- name: Setup Node (uses version in .nvmrc) | ||
uses: actions/setup-node@v3 | ||
|
@@ -61,7 +68,7 @@ jobs: | |
publish: yarn changeset publish | ||
version: yarn changeset:version-and-format | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} | ||
SKIP_POSTINSTALL_DEV_SETUP: true | ||
|
||
# Publish canary releases only if the packages weren't published already | ||
|
@@ -72,4 +79,4 @@ jobs: | |
yarn changeset version --snapshot canary | ||
yarn changeset publish --tag canary | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} |