Uh oh!
There was an error while loading. Please reload this page.
feat(update-consumers): fork-PR fallback, caller-permissions sync, dry-run - #92
Merged
Merged
Conversation
…y-run Open a cross-repo PR from a machine-user fork when the consumer repo denies write access (same routing as migrate-consumers), and raise the caller's permissions: grants to what the pinned review-pr.yml requires (issue #72: actions read -> write) so a version bump can no longer break callers at startup validation. Add dry-run (default true) and a repos allowlist for pilot runs, plus a job summary for triage.
Sayt-0
enabled auto-merge (squash)
August 24, 2026 16:20
ronan-thibaut-glitch
approved these changes
Aug 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
Sayt-0 added a commit
that referenced
this pull request
Aug 25, 2026
## Summary The first live dry run of `update-consumers.yml` (run [32826389044](https://github.com/docker/docker-agent-action/actions/runs/32826389044), after #92) discovered the action repo itself as a consumer and showed a diff that would have mangled the workflow's own discovery query. This PR excludes the action repos from discovery. | | | |---|---| | Cause | the code-search query inside `update-consumers.yml` contains `docker/docker-agent-action/.github/workflows/review-pr.yml@` as a literal string, so the repo matches its own search | | Why latent until now | while the repo still had a `pr-review.yml` caller, `unique_by(.repo)` picked that file (updated by #86 and earlier releases); since the rename to `self-review-pr.yml`, which calls the reusable workflow via a local ref (`uses: ./.github/workflows/review-pr.yml`, no `@`), the only remaining match in the repo is the query string itself | | Impact if executed for real | a self-addressed PR rewriting the query line (quote, filters and line continuation destroyed), breaking the workflow | | Handled by | dropping `^docker/(docker-agent-action|cagent-action) ` lines right after discovery, mirroring the migrate-consumers guard; `cagent-action` is excluded too since it holds a copy of these workflows | ## Dry-run evidence ``` Processing docker/docker-agent-action (.github/workflows/update-consumers.yml)... DRY RUN - route: direct; diff that would be committed: - -f q='org:docker "docker/docker-agent-action/.github/workflows/review-pr.yml@" language:YAML path:.github/workflows' \ + -f q='org:docker "docker/docker-agent-action/.github/workflows/review-pr.yml@06e1767 # v2.0.5 ``` No writes were performed (dry run). The rest of the run was nominal: 49 repos routed (17 direct / 29 fork / 3 skip), 33 consumers flagged for the `actions: read` to `write` caller bump. ## Validation | Check | Result | |---|---| | actionlint, `bash -n` on the extracted step script | clean | | harness with the action repos injected into the fake search results | self repos never cloned nor processed; direct/fork/skip routing regression intact in both dry-run and execute modes |
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 freeto 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.
Summary
update-consumers.ymlcan now deliver version-bump PRs to consumer repos where the machine user has no write access (fork fallback), and keeps those PRs from breaking callers whosepermissions:grants are below what the pinnedreview-pr.ymlrequires (issue #72: v2.0.3 raisedactions: readtowriteand broke callers still grantingread).Routing (ported from migrate-consumers.yml)
allow_forkinggh repo sync --force, signed commit on the fork, cross-repo PR (owner:branch)Caller-permissions sync (new
src/sync-caller-permissions)review-pr.ymlrequires from callers, reusing thecaller-permissionsextractor already used by the release-notes safeguard, so the two tools can never disagree on a release's requirement.permissions:block in place, in the same PR: raises insufficient levels, appends missing scopes. Block maps and inline{}maps supported; comments, indentation and CRLF preserved; grants are never reduced. The comparison is absolute (requirement vs granted), so a consumer that was already under-granting gets fixed regardless of the version it comes from.permissions:block,read-allshorthand,*pseudo-scope) are surfaced in the consumer PR body as a manual action instead of guessed: inventing a block would zero unlisted scopes, and the repo-default grant is unknowable from outside.changed|manual <block> <scope> <from> <to>.New workflow_dispatch inputs
dry-runtruerelease.ymltriggers itrepos""A job summary (
DRY RUN/EXECUTED) lists PRs opened (with URLs) and skipped repos with reasons.Fixes that came with the port
trap ... EXIT(traps do not stack, skip paths leaked workdirs)cleanup_workdirtrap + explicit calls on every skip path--base-ref mainhardcodedgh pr list --jq '.[0].number'can print the literal string "null"// empty(same fix migrate-consumers documents)owner:branchheadspulls?head=owner:branchon the fork routeValidation
review-pr.ymlrequirement and the README quick-start caller block)tsc,biome ci,actionlintgh(3 fixture consumers: direct onmain, fork on a non-maindefault branch, skip)--base-ref trunk,--head owner:branch); allowlist: whitespace trim and single-repo filtering verifiedSuggested first rollout
dry-run=false+repos=<one fork-route repo>: validates live fork creation, sync, signed commit on the fork, cross-repo PR.dry-run=falsewith no allowlist: full propagation.