Skip to content

Commit 018b0c0

Browse files
committed
fix: address agent review feedback
Changes based on parallel review by 4 agents (Kara, Dave, Jason, Gray): - Add inline comment explaining why SHOPIFY_GH_ACCESS_TOKEN is needed instead of GITHUB_TOKEN, and documenting its expected scope - Add permission comments (contents, pull-requests, id-token) - Add rollback step to verify no stale .changeset/*.md files exist, which would cause the release workflow to open a release PR instead of a clean rollback - Add .env to .gitignore (mitigates @changesets/changelog-github calling dotenv.config() unconditionally at import time)
1 parent b1e03c1 commit 018b0c0

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/npm-release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
if: github.repository_owner == 'Shopify'
2020
permissions:
21-
contents: write
22-
pull-requests: write
23-
id-token: write
21+
contents: write # push version commits, create GitHub releases
22+
pull-requests: write # create/update the "[ci] release" PR
23+
id-token: write # OIDC for npm provenance attestation
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -49,6 +49,12 @@ jobs:
4949
commit: '[ci] release'
5050
title: '[ci] release'
5151
env:
52+
# A PAT (not the built-in GITHUB_TOKEN) is required here. GitHub
53+
# Actions blocks events from GITHUB_TOKEN from triggering workflows,
54+
# so merging the release PR would not re-trigger this workflow for
55+
# the publish step. SHOPIFY_GH_ACCESS_TOKEN is a GitHub App token
56+
# scoped to this repo only (contents:write, pull-requests:write),
57+
# rotated every 2 hours via github-actions-access-provider.
5258
GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
5359
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5460
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ _site
2121
/.vscode
2222
.DS_Store
2323

24+
# Environment files
25+
.env
26+
.env.*
27+
2428
# TypeScript build artifacts
2529
*.tsbuildinfo
2630
/dist-types

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ If your PR doesn't need a new npm release (docs-only changes, test updates, CI c
3737
Follow these steps to roll back the `latest` CDN version without publishing a normal npm release.
3838

3939
1. Create a branch from `main` and revert the faulty code changes
40-
2. Do **not** include a changeset file
40+
2. Do **not** include a changeset file. Verify no stale `.changeset/*.md` files exist (other than `README.md`):
41+
```
42+
ls .changeset/*.md
43+
```
44+
If any exist, delete them — stale changesets would cause the release workflow to open a release PR instead of a clean rollback.
4145
3. Append `-ROLLBACK` to the version in `package.json` (e.g., `3.0.6``3.0.6-ROLLBACK`)
4246
4. Run `pnpm install` to update the lockfile
4347
5. Stage and commit your changes

0 commit comments

Comments
 (0)