Skip to content

fix(ci): isolate GitHub write token to release job - #60

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-release-workflow-token-exposure
May 29, 2026
Merged

fix(ci): isolate GitHub write token to release job#60
JSONbored merged 1 commit into
mainfrom
codex/fix-release-workflow-token-exposure

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Remediate a workflow-level elevation where contents: write left a write-scoped github.token available during dependency/tooling steps in .github/workflows/npm-publish.yml.
  • Prevent the default actions/checkout behavior from persisting potentially dangerous write credentials into local git config before untrusted package/tooling execution.
  • Ensure GitHub release creation (which requires write) is executed in a minimal, isolated job after validation and publishing complete.

Description

  • Changed the workflow-level permission in .github/workflows/npm-publish.yml from contents: write to contents: read.
  • Scoped the publish job with permissions: contents: read and id-token: write so tooling steps run with read-only repo access.
  • Added persist-credentials: false to the actions/checkout step to avoid writing the token into git config before npm ci/tests/build steps.
  • Moved the GitHub release creation into a new github-release job that runs needs: publish and is the only job granted contents: write and which uses GH_TOKEN: ${{ github.token }}.

Testing

  • Ran git diff --check which produced no whitespace or diff-check failures and succeeded.
  • Validated YAML syntactic correctness with ruby -e 'require "yaml"; YAML.load_file(".github/workflows/npm-publish.yml")' which succeeded.
  • Attempted npm run actionlint but it was blocked by network/DNS resolution in the environment (github-actionlint: getaddrinfo EAI_AGAIN github.com).

Codex Task

@dosubot dosubot Bot added the size:XS label May 29, 2026
@JSONbored JSONbored self-assigned this May 29, 2026
@JSONbored
JSONbored merged commit a60fb38 into main May 29, 2026
5 checks passed
@JSONbored
JSONbored deleted the codex/fix-release-workflow-token-exposure branch May 29, 2026 21:43
@JSONbored JSONbored added the bug label May 30, 2026
james3773 pushed a commit to james3773/gittensory that referenced this pull request May 31, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant