fix(ci): inline system-map dispatch for this public repo - #272
Conversation
This repo is public; the shared system-map dispatcher lives in the private ORO-AI/.github repo. GitHub does not allow a public repo to call a private repo's reusable workflow, so the thin `uses:` caller failed every run with "workflow was not found" (Invalid workflow file), and this repo's changes never reached the system map. Inline the dispatcher's two steps (diff the PR's changed files, then repository_dispatch to oro-system-map when files changed and the PAT is present) so there is no cross-repo private reusable-workflow dependency. Behaviour is identical to the shared dispatcher; the private mapped repos keep using the reusable caller. Comment cross-references both files so they stay in sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| - name: Dispatch to oro-system-map | ||
| # Guard: skip cleanly when nothing changed OR the PAT is absent (unset secret / fork PR). | ||
| if: steps.diff.outputs.files != '' && env.MAP_SYNC_PAT != '' | ||
| uses: peter-evans/repository-dispatch@v3 |
There was a problem hiding this comment.
Mutable action handles repository PAT
The workflow passes MAP_SYNC_PAT to peter-evans/repository-dispatch@v3, whose mutable tag can be repointed without this repository changing, exposing the token to unreviewed action code. Pin the action to a full commit SHA to keep the executed code immutable.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/system-map.yml
Line: 48
Comment:
**Mutable action handles repository PAT**
The workflow passes `MAP_SYNC_PAT` to `peter-evans/repository-dispatch@v3`, whose mutable tag can be repointed without this repository changing, exposing the token to unreviewed action code. Pin the action to a full commit SHA to keep the executed code immutable.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
shardi-b
left a comment
There was a problem hiding this comment.
Review: PR #272 — fix(ci): inline system-map dispatch for this public repo
Decision: approve. No blocking (≥80) findings.
What the PR does
Replaces an unusable cross-repo reusable-workflow call (a public repo cannot call the private ORO-AI/.github reusable workflow, which failed every PR with "workflow was not found") with an inlined dispatch job in .github/workflows/system-map.yml. The job collects the PR's changed files via gh pr diff --name-only and dispatches a repository_dispatch (source-pr) event to ORO-AI/oro-system-map, guarded on non-fork PRs, a non-empty file list, and the presence of MAP_SYNC_PAT.
Correctness assessment (no defects found)
- Secret-in-
ifpattern is valid.MAP_SYNC_PATis set as a job-levelenv, then the dispatch step testsenv.MAP_SYNC_PAT != ''. Theenvcontext is available in step-levelifconditions, and routing a secret throughenvis the sanctioned workaround forsecretsnot being usable inif. Works as intended. - Failure handling is correct. GitHub's default
run:shell uses-eo pipefail, so agh pr difffailure fails the step; thefiles=$(...)command substitution underset -ealso aborts on error. Failing loudly is the desired behavior. - Permissions are sufficient.
contents: read+pull-requests: readcovergh pr diff --name-only(REST/pulls/{n}/files); noactions/checkoutis required sinceghuses the API. - Payload is injection-safe and valid.
client-payloadwrapsrepo/sha/filesintoJSON(), which emits properly escaped JSON strings; the multi-line|block is valid JSON.github.event.numberand the fork guard are valid onpull_request.
Non-blocking observations (intentionally not raised as blocking findings)
- Unpinned third-party action (
peter-evans/repository-dispatch@v3). Greptile suggested pinning to a commit SHA because the action receives the PAT. This is reasonable hardening, but every other action in this repo's workflows uses mutable major-version tags (actions/checkout@v4,docker/build-push-action@v5,astral-sh/setup-uv@v7, etc.), so requiring a SHA pin here would break with established convention rather than fix a defect. Below threshold. - Space-joined
filesstring. Filenames are joined with spaces (tr '\n' ' '), so a filename containing a literal space would be ambiguous to the consumer. Extremely rare in a code repo and plausibly matches the prior dispatcher's format; low severity. - Unverifiable parity with the shared dispatcher. The PR claims behavioral identity with the private
ORO-AI/.githubdispatcher, but that repo isn't visible here, so payload/event-type parity can't be confirmed. Low confidence; not actionable from this diff.
None of these reach the blocking threshold, so the change is approved.
Description
The
system-mapworkflow has failed on every PR in this repo since it was installed, with a startup error:Root cause: this repo is public, and the shared system-map dispatcher lives in the private
ORO-AI/.githubrepo. GitHub does not allow a public repository to call a private repository's reusable workflow, so the thinuses:caller (which works fine in the private mapped repos) can never resolve the workflow here. Consequence: this repo's changes never reach the system map, and every PR shows a redsystem-mapcheck.Changes Made
.github/workflows/system-map.yml(diff the PR's changed files →repository_dispatchtooro-system-mapwhen files changed and theMAP_SYNC_PATsecret is present), removing the cross-repo private reusable-workflow dependency.Issue Link
Testing
Manual Testing
dispatchjob,pull_requesttrigger).pull_requestrun uses the workflow from the base branch, so this new version is first exercised on the next PR after merge tomain; that run should dispatch asource-prevent tooro-system-map(visible as anupdate-from-sourcerun there) instead of the current startup failure.Test Results: YAML valid; job
dispatch, triggerpull_request.Automated Testing
Test Command(s):
python -c "import yaml; yaml.safe_load(open('.github/workflows/system-map.yml'))"Documentation
Documentation Changes:
Header comment explains the public-repo constraint and points at the shared dispatcher to keep in sync.
Checklist
Additional Notes
Follow-up option (not done here): if more public repos need the map sync, or the dispatcher starts changing, relocate the shared dispatcher to a public workflows repo and repoint all callers — that restores a single source of truth. For now the dispatcher is effectively frozen, so inlining is the low-cost fix.
🤖 Generated with Claude Code
Greptile Summary
The PR replaces an unusable cross-repository reusable-workflow call with an inline job that collects changed PR files and dispatches a
source-prevent to the system-map repository.MAP_SYNC_PATare present.Confidence Score: 4/5
The PR appears safe to merge, with a non-blocking recommendation to pin the PAT-consuming third-party action to an immutable commit.
The inline workflow removes the inaccessible reusable-workflow dependency, while its remaining concern is the supply-chain exposure created by passing the dispatch PAT to an action selected through a mutable tag.
Files Needing Attention: .github/workflows/system-map.yml
Security Review
The new dispatch step supplies
MAP_SYNC_PATtopeter-evans/repository-dispatch@v3, whose mutable tag leaves the token exposed to a future compromised or repointed action revision. How this was verified: The changed step resolves a mutable@v3reference and passes the PAT directly through itstokeninput.Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(ci): inline system-map dispatch for ..." | Re-trigger Greptile