ci(action): drop jq dependency, guard gh, declare Node >=20 engine#52
Merged
Conversation
The composite Action parsed the PR event payload with the standalone `jq` binary (base SHA, PR number) and called `gh` unconditionally for the sticky comment. Both are present on GitHub-hosted Ubuntu but can be missing on self-hosted or minimal runners, failing the step hard. - Read the PR base SHA and number from GITHUB_EVENT_PATH with Node (always available — this is a Node action), wrapped in try/catch so a missing or malformed event degrades to empty rather than aborting under `set -e`. (The `gh api --jq` filter is gh's built-in jq, not the binary, so it stays.) - Guard the sticky-comment block with `command -v gh`; emit a ::notice and skip when gh is absent instead of failing — the Markdown report is still in the step summary. - Declare engines.node ">=20" in package.json (and the lockfile's root entry) so local CLI failure modes on old Node are obvious. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 free
to 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.
Addresses review findings #8 and #9.
#8 — Action portability
The composite Action parsed the PR event payload with the standalone
jqbinary (base SHA, PR number) and invokedghunconditionally for the sticky comment. Both ship on GitHub-hosted Ubuntu but can be missing on self-hosted / minimal runners, failing the step hard.jq: read the PR base SHA and number fromGITHUB_EVENT_PATHwith Node (always available — this is a Node action), each wrapped intry/catchso a missing/malformed event degrades to empty instead of aborting underset -e.gh api --jq …filter is gh's built-in jq, not the binary, so it stays.gh: wrap the sticky-comment block incommand -v gh; when gh is absent, emit a::noticeand skip rather than fail — the Markdown report is already in the step summary.#9 — Node engine
Declare
"engines": { "node": ">=20" }inpackage.jsonand keep the lockfile's root entry in sync, so running the CLI on an unsupported Node version surfaces a clear error. (agent-gov-corealready requires>=20.)Tests
Verified the Node extraction snippets behave (correct values; empty on missing file). New tests assert the action no longer uses the
jqbinary for the event, reads it viaprocess.env.GITHUB_EVENT_PATH, guardsghwithcommand -v, and that bothpackage.jsonand the lockfile declare the engine. All 120 tests pass.🤖 Generated with Claude Code