You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 30, 2026. It is now read-only.
persistLocal generates act-test.yml without a permissions block (trips CodeQL) #95
The persistLocal feature generates .github/workflows/act-test.ymlwithout a top-level permissions block. Because the file lives under .github/workflows/, GitHub treats it as a real workflow, and GitHub Advanced Security (CodeQL) immediately flags it:
Workflow does not contain permissions — Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block…
Every consumer that enables persistLocal and commits the generated workflow (the documented pattern) inherits this alert on their first PR.
contents: read is sufficient for the checkout + local-action template. (An action under test that needs more can be widened by the consumer, but the generated default should be least-privilege, not unset.)
Notes
persistLocalpreserves an existing act-test.yml on rebuild (it does not overwrite), so this only needs fixing in the initial template/generation — once correct, it sticks. That's also why a consumer's manual permissions: edit survives, but consumers shouldn't have to discover and apply that workaround.
Some already-migrated actions (e.g. silk-release-action) carry the permissions: block in their committed act-test.yml (apparently added by hand), while a freshly generated one (e.g. silk-sync-action) does not — confirming the generator, not the consumer, is the right place to fix this.
Repro
In any action repo, add action.config.ts with persistLocal: { enabled: true, path: ".github/actions/local" }.
pnpm run build.
Inspect .github/workflows/act-test.yml → no permissions: block.
Push → CodeQL "Workflow does not contain permissions" alert.
Context
Surfaced during the savvy-web/silk-sync-action migration; GitHub Advanced Security and the cloud reviewer both flagged the generated workflow on the PR. Worked around there by hand-adding permissions: contents: read, but the fix belongs in the generator.
Activity