Skip to content

ci: changeset version update - #1874

Merged
jannik-stacks merged 3 commits into
mainfrom
fix/changeset-version-github-token
Jun 29, 2026
Merged

ci: changeset version update#1874
jannik-stacks merged 3 commits into
mainfrom
fix/changeset-version-github-token

Conversation

@jannik-stacks

@jannik-stacks jannik-stacks commented Jun 29, 2026 •

Copy link
Copy Markdown
Collaborator
  • add github token where needed
  • tighten permissions and move to per job instead or per whole file

changeset version uses @changesets/changelog-github, which calls the
GitHub API to build changelog entries. Without GITHUB_TOKEN it fails
once committed changesets are present on the merge ref. The release
path already sets the token; the snapshot and pr jobs did not.
Replace the broad workflow-level token grant (contents/pull-requests/
id-token: write) with a read-only default, and opt each job up to only
what it uses: release keeps contents+id-token write, snapshot drops to
read+id-token, pr gets read+id-token+pull-requests, pre-run gets
actions: write for cancel-previous. Limits the token exposed to
untrusted PR/branch code in the snapshot and pr jobs.
@jannik-stacks jannik-stacks changed the title ci: changeset version GitHub token ci: changeset version update Jun 29, 2026
@jannik-stacks
jannik-stacks requested review from a team and Copilot June 29, 2026 16:03
@jannik-stacks
jannik-stacks enabled auto-merge (squash) June 29, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the publish GitHub Actions workflow to use least-privilege permissions per job, while ensuring Changesets versioning has access to GITHUB_TOKEN where needed.

Changes:

  • Reduces workflow-level permissions to contents: read and scopes elevated permissions to the specific jobs that require them.
  • Adds job-level permissions for pre-run, release, snapshot, and pr jobs (including id-token: write for npm OIDC and pull-requests: write only where required).
  • Exports GITHUB_TOKEN to the npx changeset version step in snapshot and pr jobs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hstove-stacks hstove-stacks left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jannik-stacks
jannik-stacks merged commit 36fcdc0 into main Jun 29, 2026
8 checks passed
@jannik-stacks
jannik-stacks deleted the fix/changeset-version-github-token branch June 29, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants