Skip to content

ci: grant actions:write to PR review workflow - #14004

Merged
glours merged 1 commit into
docker:mainfrom
glours:fix-pr-review-actions-permission
Aug 13, 2026
Merged

ci: grant actions:write to PR review workflow#14004
glours merged 1 commit into
docker:mainfrom
glours:fix-pr-review-actions-permission

Conversation

@glours

@glours glours commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What I did
docker-agent-action v2.0.3 raised the review job's required permission from actions:read to actions:write (cache delete for review-lock release, feedback artifact management). GitHub refuses to start a reusable workflow requesting more permissions than the caller grants, so every PR Review run since the v2.0.3 bump ended in startup_failure and docker-agent stopped launching automatically.

Related issue

Screenshot 2026-08-05 at 12 30 08

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

@glours
glours requested review from a team as code owners August 5, 2026 10:30
@glours
glours requested a review from ndeloof August 5, 2026 10:30
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

checks: write # (Optional) Show review progress as a check run
id-token: write # Required for OIDC authentication to AWS Secrets Manager
actions: read # Download artifacts from trigger workflow
actions: write # Download artifacts from trigger workflow; cache delete for review-lock release (required since docker-agent-action v2.0.3)

@crazy-max crazy-max Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

reusable workflows should never define permissions

I think reusable workflows should define the minimum permissions they need, following least-privilege.

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.

It also causes consumers to fail fast/loud if they're missing required permissions. We've run into silent/annoying errors in the past.

@crazy-max crazy-max Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

following least-privilege.

It doesn't work like that unfortunately: https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#supported-keywords-for-jobs-that-call-a-reusable-workflow

... permissions passed from the caller workflow can be only downgraded (not elevated) by the called workflow.

For example in our reusable workflow we don't need packages: write for registries other than GHCR and if we define packages: read it cannot be elevated:

The nested job 'build' is requesting 'packages: write', but is only allowed 'packages: read'.

Not sure about docker/docker-agent-action pr-review workflow need all these write access?

So defining elevated permissions even if not needed feels over-scope

@derekmisler derekmisler Aug 13, 2026

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.

Not sure about docker/docker-agent-action pr-review workflow need all these write access?

Yeah, we got to the permissions we have now incrementally as we ran into failures by consumers (I have like half a dozen of my own PRs just bumping individual permissions, similar to this PR).

It doesn't work like that unfortunately: https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#supported-keywords-for-jobs-that-call-a-reusable-workflow

That's interesting, I understood that doc as implying reusable workflows SHOULD define their own permissions but only to downgrade, rather than elevate. Thank you for sharing that!

Regardless, all of this is moot once our AI reviewer is moved off of GHA and into our own infra, which is currently in progress.

docker-agent-action v2.0.3 raised the review job's required permission
from actions:read to actions:write (cache delete for review-lock
release, feedback artifact management). GitHub refuses to start a
reusable workflow requesting more permissions than the caller grants,
so every PR Review run since the v2.0.3 bump ended in startup_failure
and docker-agent stopped launching automatically.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours
glours force-pushed the fix-pr-review-actions-permission branch from b27cb5a to 22120ea Compare August 13, 2026 12:43
@glours
glours enabled auto-merge (rebase) August 13, 2026 12:43
@glours
glours merged commit f7585f5 into docker:main Aug 13, 2026
45 checks passed
@glours
glours deleted the fix-pr-review-actions-permission branch August 13, 2026 12:52
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.

3 participants