Combine release workflows for npm token change#787
Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates the canary release workflow into the main release workflow file and updates the Node.js version. The separate release_canary.yml file is removed, and both main and canary release jobs are now defined in a single release.yml file.
- Merges canary release workflow into main release workflow
- Updates Node.js version from 18 to 24
- Adds a non-standard "repo" field to theme/package.json
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/release_canary.yml | Deleted the standalone canary release workflow |
| .github/workflows/release.yml | Consolidated main and canary release jobs, updated Node version to 24, removed branch filters from trigger |
| theme/package.json | Added non-standard "repo" field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,13 +1,11 @@ | |||
| name: Release | |||
| on: | |||
| push: | |||
There was a problem hiding this comment.
The workflow now triggers on every push to any branch without filtering. This will cause both jobs to evaluate their conditions on every push, which is inefficient. The original workflows had proper branch filtering (main/next_major for release, branches-ignore for canary). Consider adding back branch filtering in the trigger, or accept that both jobs will be evaluated on every push (though only one will run due to the if conditions).
| push: | |
| push: | |
| branches: | |
| - main | |
| - '**' | |
| branches-ignore: | |
| - changeset-release/main |
| - name: Publish canary version | ||
| run: | | ||
| echo "$( jq '.version = "0.0.0"' package.json )" > package.json | ||
| echo -e "---\n'@primer/gatsby-theme-doctocat': patch\n---\n\nFake entry to force publishing" > .changeset/force-snapshot-release.md | ||
| rm -f .changeset/pre.json | ||
| npx changeset version --snapshot | ||
| npx changeset publish --tag canary |
There was a problem hiding this comment.
The canary release job is missing NPM authentication setup. The original release_canary.yml workflow (lines 31-37) created an .npmrc file with NPM_TOKEN for authentication. Without this, the 'changeset publish' command on line 65 will fail when attempting to publish to npm.
|
|
||
| release-canary: | ||
| name: Canary | ||
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' }} |
There was a problem hiding this comment.
The canary job condition excludes 'changeset-release/main' but the original workflow excluded all 'changeset-release/**' branches (using branches-ignore pattern). This may allow canary releases from other changeset-release branches like 'changeset-release/next_major'. Consider using 'startsWith(github.ref_name, "changeset-release/")' to match the original behavior.
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' }} | |
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && !startsWith(github.ref_name, 'changeset-release/') }} |
|
|
||
| release-canary: | ||
| name: Canary | ||
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' }} |
There was a problem hiding this comment.
The canary job condition also needs to exclude 'dependabot/**' branches, which were excluded in the original release_canary.yml workflow (line 7 in the old file). Without this exclusion, the workflow will attempt to create canary releases for dependabot branches.
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' }} | |
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' && !startsWith(github.ref_name, 'dependabot/') }} |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.