refactor(ci): replace actions/github-script with gh CLI in amber-issue-handler#601
Open
jeremyeder wants to merge 1 commit intoambient-code:mainfrom
Open
refactor(ci): replace actions/github-script with gh CLI in amber-issue-handler#601jeremyeder wants to merge 1 commit intoambient-code:mainfrom
jeremyeder wants to merge 1 commit intoambient-code:mainfrom
Conversation
…e-handler Replace all 5 `actions/github-script@v8` blocks with `gh` CLI equivalents: - Extract issue details: `gh issue view` + `jq` instead of Octokit JS - Report no changes: `gh issue comment` instead of 35-line JS block - Validate changes: shell `git diff --stat` + `gh issue comment` - Create/update PR: `gh pr create` / `gh pr comment` instead of 170-line JS block with retry/backoff infrastructure - Report failure: `gh issue comment` instead of 45-line JS block Also simplifies "Check for existing PR" to use `gh pr list --search` instead of complex jq regex matching on PR bodies. Removes retry/backoff infrastructure entirely (~40 lines of retryWithBackoff + safeComment) — if gh fails, the step fails, and the existing "Report failure" step handles notification. Drops regex-based file path extraction from issue body (Claude receives the full issue body via the prompt template and can identify files itself). Net reduction: 296 deletions, 137 insertions (-159 lines). Closes ambient-code#600 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
refactor. features rename the same. |
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.
Summary
actions/github-script@v8blocks withghCLI equivalents, eliminating the JavaScript dependency entirelyretryWithBackoff,safeComment) — ifghfails, the step fails, and the existing "Report failure" step handles notificationgh pr list --searchinstead of complexjqregex matchingNet reduction: 296 deletions, 137 insertions (-159 lines, from 656 → 496)
What changed
actions/github-script@v8with Octokit + regex parsinggh issue view+jqjqregextest("Closes #N($|[^0-9])")gh pr list --search "Closes #N"gh issue commentexecFile('git', ['diff'])+ Octokit commentgit diff --stat+gh issue commentgh pr create/gh pr comment(~60 lines)gh issue comment(~15 lines)What did NOT change
id-token: write)Test plan
python3 -c "import yaml; yaml.safe_load(open(...))"— passed)actionlintpasses (all findings are pre-existing shellcheck info — passed)actions/github-scriptreferences remain (grep — passed)amber:auto-fixand verify full flowCloses #600
🤖 Generated with Claude Code