ci(core): drop GITHUB_TOKEN fallback from SOP/review gates; clarify token error #3028
Reference in New Issue
Block a user
Delete Branch "fix/316-drop-github-token-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes internal#316.
Removes the
|| secrets.GITHUB_TOKENfallback from all workflows that sourceGITEA_TOKENviasecrets.SOP_CHECKLIST_GATE_TOKEN.GITHUB_TOKENcan never satisfy these gates because it lacksread:orgscope for team-membership checks; the fallback only masked a missing-secret failure with a confusing 403 mid-script.sop-checklist.yml,audit-force-merge.yml,qa-review.yml,gate-check-v3.yml,security-review.ymlnow use onlysecrets.SOP_CHECKLIST_GATE_TOKEN.sop-checklist.pyerror message now names the required secret and the reason the fallback was removed.test_gate_review_auto_fire.pyassertions to expect the exactSOP_CHECKLIST_GATE_TOKENexpression.Test plan
python3 -m pytest .gitea/scripts/tests/test_gate_review_auto_fire.py -vpasses (11/11).bash .gitea/scripts/tests/test_no_tier_regression.shpasses.5-axis review on head
10b5b21c: APPROVED. Correctness: workflows now consistently usesecrets.SOP_CHECKLIST_GATE_TOKENwithout the misleadingGITHUB_TOKENfallback, and the script error names the required secret plus the read:org reason. Tests assert the exact token expression for QA/security refire. Robustness/readability improve by failing loud on missing intended secret. Security: avoids accidentally relying on an insufficient token. Performance: no impact.APPROVED after independent 5-axis review.
Correctness: the SOP/review/audit workflows now require
SOP_CHECKLIST_GATE_TOKENexplicitly instead of silently falling back toGITHUB_TOKEN, and the script error explains why the dedicated token is required. Robustness: fail-fast on missing read:org-capable token is preferable to false gate behavior. Security: removes accidental use of an under-scoped/default token. Performance: no material impact. Readability/tests: workflow env changes are consistent and the refire tests assert the intended token separation.