-
Notifications
You must be signed in to change notification settings - Fork 53
Combine release workflows for npm token change #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8b4b00c
6926421
95af9ec
5b6f319
b18446f
7d92a58
6ca873d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "name": "Doctocat Dev Container", | ||
| "image": "mcr.microsoft.com/devcontainers/javascript-node:24", | ||
|
|
||
| // Configure tool-specific properties. | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "dbaeumer.vscode-eslint", | ||
| "esbenp.prettier-vscode", | ||
| "GitHub.copilot", | ||
| "GitHub.copilot-chat" | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| // Features to add to the dev container. More info: https://containers.dev/features. | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {}, | ||
| "ghcr.io/devcontainers/features/github-cli:1": {} | ||
| }, | ||
|
|
||
| // Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
| "forwardPorts": [8000, 9000], | ||
|
|
||
| // Use 'postCreateCommand' to run commands after the container is created. | ||
| "postCreateCommand": "npm install", | ||
|
|
||
| // Configure the container to run as a non-root user with the same UID/GID as your local user. | ||
| "remoteUser": "node" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,13 +1,21 @@ | ||||||||||
| name: Release | ||||||||||
| on: | ||||||||||
| push: | ||||||||||
| branches: | ||||||||||
| - 'main' | ||||||||||
| - 'next_major' | ||||||||||
|
|
||||||||||
| concurrency: | ||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||
| cancel-in-progress: true | ||||||||||
|
|
||||||||||
| permissions: | ||||||||||
| id-token: write # Required for OIDC | ||||||||||
| contents: read | ||||||||||
| checks: write | ||||||||||
| statuses: write | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| release: | ||||||||||
| name: Final | ||||||||||
| if: ${{ github.repository == 'primer/doctocat' }} | ||||||||||
| release-main: | ||||||||||
| name: Main | ||||||||||
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name == 'main' }} | ||||||||||
|
|
||||||||||
| runs-on: ubuntu-latest | ||||||||||
| steps: | ||||||||||
|
|
@@ -21,19 +29,64 @@ jobs: | |||||||||
| - name: Set up Node.js | ||||||||||
| uses: actions/setup-node@v6 | ||||||||||
| with: | ||||||||||
| node-version: 18 | ||||||||||
| node-version: 24 | ||||||||||
| cache: 'npm' | ||||||||||
|
|
||||||||||
| - name: Install dependencies | ||||||||||
| run: npm ci | ||||||||||
|
|
||||||||||
| - name: Create release pull request or publish to npm | ||||||||||
| id: changesets | ||||||||||
| uses: changesets/action@master | ||||||||||
| uses: changesets/action@v1 | ||||||||||
| with: | ||||||||||
| title: Release Tracking | ||||||||||
| # This expects you to have a script called release which does a build for your packages and calls changeset publish | ||||||||||
| publish: npm run release | ||||||||||
| env: | ||||||||||
| GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }} | ||||||||||
| NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }} | ||||||||||
|
|
||||||||||
| release-canary: | ||||||||||
| name: Canary | ||||||||||
| 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' }} | |
| if: ${{ github.repository == 'primer/doctocat' && github.ref_name != 'main' && !startsWith(github.ref_name, 'changeset-release/') }} |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/') }} |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v18 | ||
| v24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).