Skip to content

ci: split npm publish and github release into separate jobs - #26

Merged
TimG1804 merged 1 commit into
mainfrom
ci/split-release-permissions
Sep 18, 2026
Merged

TimG1804 merged 1 commit into
mainfrom
ci/split-release-permissions

Conversation

@TimG1804

Copy link
Copy Markdown
Collaborator

Closes the last open point of #4: contents: write applied to the entire
job, so npm publish and both third-party actions ran with repo write
access.

Actions has no step-level permissions, so splitting the job is the only way
to scope it:

  • publish-npm — contents: read + id-token: write, no third-party
    actions beside it
  • github-release — contents: write, installs no dependencies

The OIDC credential and the repo write token no longer share a job.

The workflow filename is deliberately unchanged: npm's trusted publisher
config pins it, and renaming would break publishing at the next tag. Job
names are not part of that config.

Note this workflow only runs on tag push, so CI does not exercise it — the
change is verified by inspection and first runs for real at the next release.

Last open point of #4: contents: write applied to the whole job, so the
publish step and both third-party actions ran with it.

Actions has no step-level permissions, so the split is the only way to
scope it. npm publish now runs with contents: read + id-token: write and
no third-party actions beside it; release creation gets contents: write
but installs no dependencies. The OIDC credential and the repo write
token no longer share a job.

The filename stays as is — npm's trusted publisher config pins the
workflow filename, and renaming it would break publishing at the next
tag. Job names are not part of that config.

Refs #4

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TimG1804
TimG1804 merged commit 3a3085a into main Sep 18, 2026
1 check passed
@TimG1804
TimG1804 deleted the ci/split-release-permissions branch September 18, 2026 12:02
TimG1804 added a commit that referenced this pull request Sep 18, 2026
Last open point of #4: contents: write applied to the whole job, so the
publish step and both third-party actions ran with it.

Actions has no step-level permissions, so the split is the only way to
scope it. npm publish now runs with contents: read + id-token: write and
no third-party actions beside it; release creation gets contents: write
but installs no dependencies. The OIDC credential and the repo write
token no longer share a job.

The filename stays as is — npm's trusted publisher config pins the
workflow filename, and renaming it would break publishing at the next
tag. Job names are not part of that config.

Refs #4
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.

1 participant