Repository navigation
ci(gha-tokens): read-only workflow tokens, no saved checkout credentials, SHA-pinned actions - #22
Merged
Merged
Conversation
…als, SHA-pinned actions - Top-level `permissions: contents: read` in all three workflows - pages.yml: `pages: write` + `id-token: write` move from the top level to the `deploy` job - publish.yml: split into `build` (read-only, runs `npm ci`) and `publish` (`contents: write` + `id-token: write`, installs nothing, `npm publish --ignore-scripts`) - `persist-credentials: false` on every checkout - Every action pinned to a commit SHA with its version as a comment Spec: github-actions-token-hardening | Reviewed: 2026-10-04
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation: read-only workflow tokens, no saved checkout credentials, SHA-pinned actions
SDD Task:
github-actions-token-hardeningWhat was implemented
Today a job without its own
permissions:block gets the org's write-capableGITHUB_TOKEN, andactions/checkoutsaves the token it used into.git/config, where any later step (includingnpm ciinstall scripts) can read it. This PR changes all three workflows (+52/−14):ci.yml: new top-levelpermissions: contents: read. Its one job,build-and-test, runsnpm ciand now gets a read-only token.pages.yml: the top level keeps onlycontents: read.pages: writeandid-token: writemove to thedeployjob, which runs no project code. Thebuildjob, which runsnpm ciand builds the demo, is now read-only.publish.yml: split into two jobs:buildis read-only. It runsnpm ciandnpm run build:lib, then uploadsdist/grapesjs-angularas an artifact.publishkeepscontents: write(forgh release create) andid-token: write(for npm provenance). It installs nothing: it downloads the built package and runsnpm publish --ignore-scripts.persist-credentials: falseon every checkout. Nothing here needs one: the release step authenticates throughGH_TOKENin its own environment.No workflow here mints an App token, and this repo has no Claude review workflow, so no review runs on this PR.
Canary:
ilqk8s-cluster-addons#199 shipped the same pattern first; it merged and was proven on #200.What this PR's checks will and won't exercise
build-and-test(ci.yml) runs for real:npm ci, the library build and its tests, with the read-only token and no saved credential.main,ci.ymlruns again andpages.ymlbuilds and deploys the demo. That is the first real run of thedeployjob's own permissions block.publish.ymlis not exercised. It runs only when av*.*.*tag is pushed, so thebuild→publishsplit is first tested at the next release.SDD Traceability
specs/active/github-actions-token-hardening/Review
Approved on 2026-10-04 — 0 blocking issues.
Checklist
design.mdtasks for this repo implemented[BLOCKING]items left open inreview.mdorigin/main