Skip to content

fix(ci): reusable workflows must not request 'read-all' (broke callers)#43

Merged
amavashev merged 1 commit into
mainfrom
fix/reusable-workflow-permissions
May 2, 2026
Merged

fix(ci): reusable workflows must not request 'read-all' (broke callers)#43
amavashev merged 1 commit into
mainfrom
fix/reusable-workflow-permissions

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

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 added permissions: read-all to ci-java.yml and ci-python.yml, which expanded to ~15 read scopes (actions, packages, pages, statuses, etc.).

Every caller that scopes permissions narrower than read-all hits:

workflow is requesting actions: read, artifact-metadata: read, attestations: read, ... but is only allowed actions: none, artifact-me[...]

Result: startup_failure — workflow can't even create jobs.

Concrete impact

cycles-server/ci.yml declares permissions: contents: read at top level. After PR #41 merged, every CI run on cycles-server returned startup_failure. Same for any other repo calling ci-java.yml or ci-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.yml and ci-typescript.yml (which both use permissions: contents: read):

permissions:
  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-all to contents: read — actually a tightening of least privilege.

Test plan

  • Merge ASAP
  • Re-run a CI workflow on cycles-server (e.g. trigger on any PR or push) and confirm jobs now create successfully
  • Same check on cycles-client-python (calls ci-python.yml)
  • Other repos calling ci-rust / ci-typescript were never affected (those reusable workflows already had 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.

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.
@amavashev amavashev merged commit 23ec629 into main May 2, 2026
3 checks passed
@amavashev amavashev deleted the fix/reusable-workflow-permissions branch May 2, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant