fix(ci): reusable workflows must not request 'read-all' (broke callers)#43
Merged
Merged
Conversation
Reusable workflows can only request permissions the *calling* workflow has granted via its top-level permissions block. PR #41's permissions sweep added 'permissions: read-all' to ci-java.yml and ci-python.yml, which expanded to ~15 read scopes (actions, packages, pages, etc.). Every caller that grants narrower permissions hit this error: 'workflow is requesting actions: read, artifact-metadata: read, attestations: read, ... but is only allowed actions: none, ...' Concrete impact: cycles-server's ci.yml declares 'permissions: contents: read' at top level. After PR #41 merged, every CI run on cycles-server returned startup_failure (no jobs created). Same for any other repo calling ci-java.yml or ci-python.yml. Fix: match the working pattern from ci-rust.yml and ci-typescript.yml. Declare only 'permissions: contents: read' at the workflow level — the narrowest permission the workflow actually needs (Maven/pip checkout + build). Job-level permissions stay as-is. Scorecard's Token-Permissions check still passes because each workflow has explicit (non-default) permissions declared at both levels.
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.
Urgent: this PR fixes broken CI across every repo that calls our reusable Java or Python workflows.
Root cause
Reusable workflows in GitHub Actions can only request permissions the calling workflow has granted via its top-level
permissions:block. PR #41's permissions sweep addedpermissions: read-alltoci-java.ymlandci-python.yml, which expanded to ~15 read scopes (actions, packages, pages, statuses, etc.).Every caller that scopes permissions narrower than read-all hits:
Result:
startup_failure— workflow can't even create jobs.Concrete impact
cycles-server/ci.ymldeclarespermissions: contents: readat top level. After PR #41 merged, every CI run on cycles-server returned startup_failure. Same for any other repo callingci-java.ymlorci-python.yml.Confirmed via cycles-server CI run 25264324505 and earlier runs on the docs/maintainers-and-tls branch.
Fix
Match the working pattern from
ci-rust.ymlandci-typescript.yml(which both usepermissions: contents: read):Just the narrowest permission the workflow actually needs (checkout + Maven/pip build). Job-level permissions stay as-is.
Why this doesn't hurt Scorecard
Token-Permissions check passes as long as each workflow has explicit (non-default) permissions declared at workflow or job level. Both levels are still set; the workflow level just narrows from
read-alltocontents: read— actually a tightening of least privilege.Test plan
contents: read)Why it didn't surface during PR #41's CI
PR #41 itself didn't have a Java/Python project consuming the reusable workflow. The breakage only fires when a consumer repo's CI runs. cycles-server's CI didn't run on the PR #41 merge because the reusable workflow file change doesn't propagate to consumers' CI triggers.