Repository navigation
fix(dispatch): give pm-dispatch-ci-fix a default-branch default (#2672) - #2736
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Part of #2672
Bug
The
pm-dispatch-ci-fixwrapper (added in #2701) forwards all of its inputs topm-dispatch-taskwith explicitwith:entries — includingdefault-branch: ${{ inputs['default-branch'] }}. But the wrapper's owndefault-branchinput declared no default, unlikepm-dispatch-task's same-named input, which defaults to${{ github.event.repository.default_branch }}.In GitHub Actions, an explicitly passed value wins over the receiving action's declared default — even when that value is the empty string. So a caller using the wrapper exactly as intended (a
ci-fixjob with nowith:block at all) sentdefault-branch: ""intopm-dispatch-task, silently suppressing the task action's own default instead of letting it apply.That matters because
pm-dispatch-task's resolve step only setsis_default_branch=truewhen the default-branch input is non-empty and equal to the failed run's branch. With the empty string it can never match, so a fresh ci-fix failure on the repo's default branch — the main case this wrapper exists for — was misrouted: it went topm-dispatch-queueatnormalpriority instead ofpm-dispatch-startathighpriority.Fix
One line: give the wrapper's
default-branchinput the same default the task action declares,${{ github.event.repository.default_branch }}, so an unset wrapper input now forwards the real default branch instead of an empty string.Audit of the other pass-through inputs
Checked every other input the wrapper forwards, against both the wrapper's and
pm-dispatch-task'saction.yml:pm-dispatch-tasktreats empty as unset):title— fortask: ci-fixthe task action ignores this input entirely and always uses the conventionalci-fix: <workflow> failing on <branch>title.model— the task action forwards it to the starter/queuer only when non-empty.priority— when empty, the task action's resolve step defaults ci-fix priority tohighon the default branch andnormalotherwise.repo→${{ github.repository }}workflow→${{ github.workflow }}run-id→${{ github.run_id }}run-url→${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}branch→${{ github.head_ref || github.ref_name }}sha→${{ github.sha }}pralso already carries a default (${{ github.event.pull_request.number }}); it is empty on non-PR events by design, and the task action substitutes it as an optional placeholder, so it is safe.default-branchwas the only pass-through input where an empty string changed behaviour instead of meaning "unset".README
Checked the
pm-dispatch-ci-fixwrapper subsection ofpm-stack/dispatch/README.md: it does not state thatdefault-branchhas no default (it lists the context inputs that default from the calling run and does not mentiondefault-branch), so no README change was needed or made.Verification
action.ymlwithyq: parses cleanly, andinputs."default-branch".defaultreads back as${{ github.event.repository.default_branch }}..github/actions/pm-dispatch-ci-fix/action.yml; no other files touched.Need help on this PR? Tag
@codesmith-botwith what you need.