Skip to content

Add PR check run lifecycle - #41

Merged
pweiskircher merged 5 commits into
mainfrom
agent/check-run-lifecycle
Aug 5, 2026
Merged

Add PR check run lifecycle#41
pweiskircher merged 5 commits into
mainfrom
agent/check-run-lifecycle

Conversation

@pweiskircher

Copy link
Copy Markdown

What changed

  • publish an advisory Check Run against the exact PR head SHA
  • optionally own the exact-SHA checkout after trigger validation
  • react to explicit review commands before cloning the repository
  • allow explicit same-SHA review retries to bypass automatic deduplication

Why

issue_comment workflows are attached to the default branch, which made comment-triggered reviews appear inert and caused callers to clone the default branch before resolving the PR. The Check Run makes progress visible on the PR and the action-owned checkout removes that unnecessary clone.

Validation

  • node --test scripts/check-run.test.js
  • ./scripts/test-detect-trigger-type.sh
  • ./scripts/test-determine-claudecode-enablement.sh
  • parsed action.yml as YAML

@pweiskircher
pweiskircher marked this pull request as ready for review August 5, 2026 14:24
@pweiskircher
pweiskircher requested a lite review from Copilot August 5, 2026 14:29

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📋 PR Summary:
This PR lets the action own the exact-SHA PR checkout after trigger validation and publish an advisory GitHub Check Run on the PR head, making comment-triggered reviews visibly progress on the PR instead of appearing inert. It adds a new Node script (check-run.js) that creates/completes a Check Run via the GitHub API, reworks the local git setup to avoid re-materializing large repos, and broadens the same-SHA deduplication bypass so explicit comment triggers can be retried. Check Run publishing and the action-owned checkout are opt-in via new inputs and fail gracefully.

7 files reviewed
File Changes
action.yml Add checkout-pr/publish-check/check-name inputs, Check Run steps, and mixed-reset git diff prep
scripts/check-run.js New script to create/complete an advisory Check Run via GitHub API
scripts/check-run.test.js node:test unit tests for Check Run payloads and run() flow
scripts/determine-claudecode-enablement.sh Broaden same-SHA dedup bypass to slash_command and mention triggers
scripts/test-determine-claudecode-enablement.sh Add test for same-SHA slash_command review comment bypass
docs & CI Document new inputs/outputs and wire up check-run test job

Found 1 reliability issue. Consider addressing the suggestions in the comments.

Comment thread scripts/determine-claudecode-enablement.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Check Run lifecycle for PR-triggered reviews so progress is visible on the PR head SHA, and refines trigger/checkout behavior to avoid cloning the default branch for issue_comment workflows.

Changes:

  • Add a Node-based helper (scripts/check-run.js) plus tests to start/complete an advisory GitHub Check Run against the exact PR head SHA.
  • Update action inputs/docs to optionally let the action own the exact-SHA checkout (checkout-pr) and to publish checks (publish-check / check-name).
  • Extend SHA deduplication to allow explicit comment/mention-triggered retries on the same SHA, and add coverage for that case.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/test-determine-claudecode-enablement.sh Adds a regression test for same-SHA retries via explicit review comment trigger.
scripts/determine-claudecode-enablement.sh Allows explicit comment/mention triggers to bypass same-SHA deduplication.
scripts/check-run.test.js Introduces Node tests covering Check Run payloads and request wiring.
scripts/check-run.js New script to create/complete GitHub Check Runs via REST API.
README.md Documents new permissions (checks: write) and new inputs/outputs for checkout and Check Runs.
action.yml Adds new inputs/outputs, starts/completes Check Runs, and optionally checks out the exact PR head SHA.
.github/workflows/test-claudecode.yml Runs the new Check Run script tests in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/check-run.js
Comment thread scripts/determine-claudecode-enablement.sh Outdated
Comment thread action.yml Outdated

@pweiskircher pweiskircher left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed the review feedback in the latest commits.

Comment thread scripts/check-run.js
Comment thread action.yml Outdated
@pweiskircher
pweiskircher merged commit 3bc5da2 into main Aug 5, 2026
2 checks passed
@pweiskircher
pweiskircher deleted the agent/check-run-lifecycle branch August 5, 2026 14:44
matej added a commit that referenced this pull request Aug 10, 2026
Resolves the action.yml conflict from #41 (check run lifecycle): both
branches added a guarded gh CLI install; kept main's variant since it
is functionally identical. Verified post-merge that the credential
strip in the scan step still runs after all checkout/fetch steps
(including the new action-owned checkout), and that the Node 22 bump
and jq guard survived the merge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants