feat: self-review uses local ./ action paths#184
Conversation
Rewrite self-review-pr.yml to inline the three jobs from review-pr.yml (resolve-context, review, reply-to-feedback, reply-to-mention) using local './' paths for all docker/cagent-action action references instead of the previously pinned SHA via the reusable workflow_call. This ensures self-review always exercises the action code on the current main branch rather than a pinned release. Changes: - Replace 'uses: ./.github/workflows/review-pr.yml' (workflow_call) with four inlined jobs copied verbatim from review-pr.yml - All 'uses: docker/cagent-action/...@<SHA>' replaced with './' local equivalents: ./.github/actions/setup-credentials, ./review-pr, ./review-pr/reply, ./review-pr/mention-reply, ./.github/actions/mention-reply - Add 'actions/checkout' (no ref) as the first step of every job so the workspace is populated with main branch code for local action resolution - Change PR head checkout to 'path: pr-head' so it does not overwrite the local action files that were just checked out - Translate workflow_call inputs to event-context equivalents: inputs.trigger-run-id -> github.event.workflow_run.id resolve-context job if: -> github.event_name == 'workflow_run' && ... trigger-run-id step guards -> github.event_name == 'workflow_run' - All third-party action SHAs are preserved unchanged - Fix .github/actions/mention-reply/action.yml: change 'node24' -> 'node20' (AGENTS.md already documented it as node20; actionlint requires node20) Assisted-By: docker-agent
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
Reviewed changes in .github/workflows/self-review-pr.yml and .github/actions/mention-reply/action.yml.
The node20 fix in mention-reply/action.yml is correct and matches project convention.
The workflow inlining is structurally sound: checkout ordering is correct (first step in every job), path: pr-head is used correctly for PR head checkouts, and inputs.* → github.event.* translations are correct.
2 NOTABLE findings (dead code from inlining — no runtime crash, but functional gaps).
self-review-pr.yml only declares three triggers (workflow_dispatch, issue_comment, workflow_run). The pull_request_review_comment event is never delivered to this workflow, so its OR clauses in the if: conditions of reply-to-feedback and reply-to-mention were dead code. reply-to-feedback: drop the direct pull_request_review_comment branch; retain only the workflow_run/resolve-context path. Also simplify away the now-redundant needs.resolve-context.result != 'failure' guard (implied by the == 'success' check that remains). reply-to-mention: drop the pull_request_review_comment branch; retain only the issue_comment branch (a live trigger). Assisted-By: docker-agent
The earlier node24 -> node20 change was unnecessary. actionlint v1.7.7 did not recognise node24 as a valid runner, but v1.7.8 added support for it (rhysd/actionlint#561). The CI lint job uses raven-actions/actionlint at 'latest' which already ships v1.7.8+, so it was never broken in CI — only in the local sandbox where an old binary was installed. Revert the action back to 'node24' and note that pnpm lint (local dev) requires actionlint >= v1.7.8 on PATH. Assisted-By: docker-agent
|
Reverted in commit The earlier |
|
/review |
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
All hypotheses were evaluated and dismissed:
reply-to-feedbackcondition simplification: The omission of the directpull_request_review_commentevent path is correct —self-review-pr.ymlhas no such trigger, so the original dual-path condition fromreview-pr.ymlwould never have fired the direct branch anyway. The simplified condition is accurate for the available triggers.reviewjob withalways()+ skippedresolve-context: GitHub Actions correctly handles skipped upstream jobs whenalways()is present. Onissue_commentevents,resolve-contextis skipped and thereviewjob evaluates its independentissue_commentbranch — as intended.reply-to-mentiononissue_commentevents: Theneeds.resolve-context.result != 'failure'pattern is deliberately chosen to pass whenresolve-contextis skipped. All required event context for mention replies is directly available from theissue_commentpayload without needingresolve-context.
The inlining of the four jobs from review-pr.yml into self-review-pr.yml with ./ local paths is correct. The PR head checkout to path: pr-head properly preserves the main-branch action files at the workspace root so that uses: ./review-pr resolves correctly. Event-context translations (inputs.trigger-run-id → github.event.workflow_run.id, etc.) are accurate.
Summary
Rewrites
self-review-pr.ymlso it no longer delegates to the reusablereview-pr.ymlworkflow. Instead, the four jobs (resolve-context,review,reply-to-feedback,reply-to-mention) are inlined directly with./local paths for alldocker/cagent-actionaction references.This ensures self-review always exercises the action code on the current
mainbranch rather than a pinned release SHA.Changes
.github/workflows/self-review-pr.ymluses: ./.github/workflows/review-pr.yml(workflow_call) delegationreview-pr.yml, with these targeted changes:docker/cagent-action/...@<SHA>references:docker/cagent-action/.github/actions/setup-credentials@<SHA>./.github/actions/setup-credentialsdocker/cagent-action/review-pr@<SHA>./review-prdocker/cagent-action/review-pr/reply@<SHA>./review-pr/replydocker/cagent-action/review-pr/mention-reply@<SHA>./review-pr/mention-replydocker/cagent-action/.github/actions/mention-reply@<SHA>./.github/actions/mention-reply./paths are resolvedpath: pr-headinreviewandreply-to-feedbackjobs so it does not overwrite the local action filesworkflow_callinputs translated to event-context equivalents (e.g.inputs.trigger-run-id→github.event.workflow_run.id, step-levelif: inputs.trigger-run-id != ''→if: github.event_name == 'workflow_run').github/actions/mention-reply/action.ymlnode24→node20(AGENTS.md already documented the intent asnode20; actionlint enforces valid runner names andnode24is not yet a valid value — this fix was required to makepnpm lintpass after local path resolution exposed the issue)Validation
pnpm build && pnpm lintpasses (Biome CI + tsc --noEmit + actionlint).Refs: task to make self-review dogfood current-branch code.