Skip to content

PFM-ISSUE-34282 - Use GITHUB_TOKEN with scoped permissions for in-repo tag and release - #189

Merged
vladimir-arsov merged 9 commits into
masterfrom
improvement/PFM-ISSUE-34282-Use-GITHUB_TOKEN-with-scoped-permissions-for
Nov 17, 2026
Merged

vladimir-arsov merged 9 commits into
masterfrom
improvement/PFM-ISSUE-34282-Use-GITHUB_TOKEN-with-scoped-permissions-for

Conversation

@vladimir-arsov

@vladimir-arsov vladimir-arsov commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Resolves PFM-ISSUE-34282

Summary

PFM-ISSUE-34282: push the FE release flow's tag with the built-in GITHUB_TOKEN and job-scoped permissions instead of the shared user PAT.

Changes

  • fe-release-flow.yml: the release job requests contents: write (was read) and checks out with the persisted default token (no token:); GIT_USER_TOKEN is no longer a declared secret; guard comment reworded (check and message unchanged). No other scope is granted anywhere in the flow.
  • Template header (workflow-templates/fe/fe-release.yml), README (migration note, required secrets, new "Tag rulesets" section, GitHub release) and the 34283 Q10 note describe the GITHUB_TOKEN tag push.
  • Unchanged: deprecated fe-tag.yml / workflows/fe-release.yml (still need the PAT), fe-main.yml, fe-snapshot.yml, the artifacts tool, the "Configure git user" step (PFM-ISSUE-34286).
  • Migrated consumers need no change: the caller already grants contents: write and passes secrets: inherit.
  • Specs: research.md, design.md, plan.md, live-test-plan.md under specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/.

Live validation (clone-cplace-fe, test branch test/PFM-ISSUE-34282-github-token)

ID Runs Verdict Note
R0 43055394399 PASS NO-RELEASE ("No projects are affected since version/26.4.7"); no startup failure, no GIT_USER_TOKEN annotation (T4); T1: release = Contents write, guard/install-deps/build = Contents read; T2 clean; tags/releases/npm/dist-tags unchanged
M0 43057515831 PASS one Main CI run, success; jobs use @test/PFM-ISSUE-34282-github-token; no projects processed, nothing published; no release/xray/tag run; tags/releases/npm/dist-tags unchanged; main perms Actions write, Contents read
R1 43061097423 PASS RELEASE(26.4.8) on 821421e4 (replay e2d33835d4b, cf-editor-lib affected): 27 tarballs = 27 log lines, release-26.4 -> 26.4.8 on all 27, no -pending, latest/snapshot unchanged; tag lightweight on head, pushed by GITHUB_TOKEN ("* [new tag] version/26.4.8"); release by github-actions[bot], latest, range 26.4.7...26.4.8; E7: no canary run (canary present in the tagged tree, active); T1 release = Contents write; T2 clean; release job 11m50s
M1 43065509491 PASS main push of replay 97b45e73a1f: 25 projects processed, 21 publishable published as one version 0.0.0-SNAPSHOT-mwcdyd6n-20261111 (tarballs == log lines); only snapshot dist-tag moved (21), release-26.x and latest unchanged; no tag/release/tag run; no 403; perms per job Actions write, Contents read (push_main.yaml grant, unchanged)
M2 43069070605 PASS forced release-flow dispatch on main: guard ok; "Forced release flow on main: publishing a snapshot of all projects"; 27 tarballs, one version 0.0.0-SNAPSHOT-mwcennd0-20261111 (== log); github-release skipped; only snapshot dist-tag moved; no tag/release, no git push in the log; T1 release = Contents write, others Contents read; T2 clean
R2 43072100301 PASS forced RELEASE(26.4.9) on BR tip 821421e4 ("Force is set: skipping the affected check"): 27 tarballs == log, release-26.4 -> 26.4.9 on 27, no -pending; lightweight tag on head pushed with GITHUB_TOKEN; release by github-actions[bot], latest, range 26.4.8...26.4.9; no canary run; T1/T2/T4 ok
R3-infra 43094775513 DEVIATION (infra) release job queued with no runner 20:24Z-21:01Z during the GitHub Actions incident of 2026-11-11 20:48Z; run marked failure, no step ran; nothing published/tagged; replaced by a fresh dispatch
R3 43200686478 (attempts 1, 2) PASS placeholder cf-shell-26.4.10. Attempt 1: failure on cf-shell ("cannot publish over ... 26.4.10"); cleanup took the ls-remote exit-code-2 path ("version/26.4.10 was not pushed: unpublishing its artifacts"), no auth error; 26 published, 27 deleted (placeholder incl.), 0 tarballs left; release-26.4 still 26.4.9, no -pending; no tag/release; github-release skipped. Attempt 2 (--failed): RELEASE(26.4.10), same N, E1-E8, tag on 821421e4 by GITHUB_TOKEN, release latest 26.4.9...26.4.10, no tag-triggered run. Side effect: cf-shell latest 26.4.6 -> 26.4.9 (placeholder, as in A8)
R4 43200686478 (attempts 3, 4) PASS re-run github-release with release present: "A GitHub release for version/26.4.10 already exists, nothing to do", releases unchanged; release deleted (404, tag kept), re-run: recreated id 442830940, author github-actions[bot], latest, range 26.4.9...26.4.10; job token Contents write; tags/npm unchanged, no tag run
R5 43206769325 PASS caller ceiling contents: read on test/ceiling, dispatch force=false: startup_failure, 0 jobs (guard never ran, so the ceiling was enforced before the ref check); state unchanged. error text (UI, confirmed by the user) names the release job requesting contents: write with only contents: read allowed
R6 – SKIPPED optional; the user chose not to delete the GIT_USER_TOKEN secret

PAT vs. GITHUB_TOKEN

PAT baseline (26.4.7, run 42292826750) 34282 (R1, run 43061097423)
release job token scope Contents: read Contents: write
Canary run on the new tag 42297425544, actor squad-fe none (also none for 26.4.9, 26.4.10)
GIT_USER_TOKEN declared yes no
GitHub release author github-actions[bot] github-actions[bot]

Deviations

  • 43094775513 (first R3 dispatch): release job queued without a runner from 20:24Z until GitHub failed the run at 21:01Z, during the GitHub Actions incident of 2026-11-11. No step ran, nothing was published. Replaced by a fresh dispatch (43200686478) on the user's decision.
  • Placeholder side effect (R3, as in LT A8): cf-shell latest 26.4.6 -> 26.4.9. Not restored (no teardown).
  • test/ceiling was first pushed identical to release/26.4 (an edit failed on line endings); no run was triggered. Deleted after R5.

Test plan

  • Implementation done (phases 1-3 of plan.md)
  • Live tests per live-test-plan.md passed (R6 skipped by decision); results above

🤖 Generated with Claude Code

@vladimir-arsov vladimir-arsov self-assigned this Nov 10, 2026
Base automatically changed from improvement/PFM-ISSUE-34283-Consolidate-the-FE-2-0-release-flow-into-a-master to master November 16, 2026 08:17
@vladimir-arsov
vladimir-arsov dismissed Karthikyadav123’s stale review November 16, 2026 08:17

The base branch was changed.

vladimir-arsov and others added 9 commits November 16, 2026 12:05
Research on moving the FE release flow's tag push from the shared user PAT
to GITHUB_TOKEN with job-scoped permissions, and the live test plan for
clone-cplace-fe (release on release/26.4, main CI and forced release flow
on main, recovery and permission-ceiling cases).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he PAT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vladimir-arsov
vladimir-arsov force-pushed the improvement/PFM-ISSUE-34282-Use-GITHUB_TOKEN-with-scoped-permissions-for branch from 9acc313 to 8adb624 Compare November 16, 2026 11:15
@vladimir-arsov
vladimir-arsov marked this pull request as ready for review November 16, 2026 11:42
required: true
GIT_USER_TOKEN:
required: true
GIT_USER:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about GIT_USER and GIT_USER_EMAIL? Can we use GITHUB_TOKEN there as well? Or this is separate issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That is a separate issue, to clean up those secrets.

@slaven3kopic
slaven3kopic self-requested a review November 17, 2026 07:55
@vladimir-arsov
vladimir-arsov merged commit 3e8a45b into master Nov 17, 2026
2 checks passed
@vladimir-arsov
vladimir-arsov deleted the improvement/PFM-ISSUE-34282-Use-GITHUB_TOKEN-with-scoped-permissions-for branch November 17, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants