From 2ab42ccf962914c1a9f316ce8884767d56d7f4d9 Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Mon, 27 Jul 2026 12:12:36 +1000 Subject: [PATCH 1/2] ci: replace gh CLI with github-script in release-PR assign step (LAB-899) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The self-hosted cachekit ARC runner has no gh CLI, so the assign step introduced-then-fixed in LAB-865 dies with exit 127 ('gh: command not found') on every push that creates or updates a release PR (run 30224112374). Swap it for SHA-pinned actions/github-script calling issues.addAssignees with the app token — no CLI dependency, no hardcoded head-branch name, and outputs.pr is parsed in JS from env rather than template-position fromJson (which evaluates even when if: is false, the original LAB-865 crash). Co-authored-by: multica-agent --- .github/workflows/release.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5514fa..76da1e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,15 +41,25 @@ jobs: # release PR here. outputs.pr is set whenever the release PR was created # OR updated, so this re-runs on every push to main while a release PR is # open — adding an already-present assignee is a no-op, so that's safe. - # The PR is selected by release-please's deterministic head branch, NOT - # fromJson(outputs.pr).number: step env templates are evaluated even when - # if: is false, so fromJson('') on a no-release push fails the whole job - # and skips publish (LAB-865). + # github-script, NOT `gh`: the self-hosted cachekit runner has no gh CLI + # (LAB-899). outputs.pr is passed raw via env and parsed in JS — never + # through template-position fromJson, which is evaluated even when if: is + # false and crashes on '' for no-release pushes (LAB-865). - name: Assign release PR to 27Bslash6 if: ${{ steps.release.outputs.pr }} - run: gh pr edit "release-please--branches--main--components--cachekit-core" --repo "$GITHUB_REPOSITORY" --add-assignee 27Bslash6 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} + PR_JSON: ${{ steps.release.outputs.pr }} + with: + github-token: ${{ steps.app-token.outputs.token }} + script: | + const pr = JSON.parse(process.env.PR_JSON); + await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + assignees: ['27Bslash6'], + }); publish: needs: release-please From 4cd780ec7c19c9fb2a3b3894928765c7d33139ed Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Mon, 27 Jul 2026 14:08:34 +1000 Subject: [PATCH 2/2] ci: add error handling to release-PR assign script (LAB-899) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kody review on #61: JSON.parse + addAssignees threw unhandled on malformed PR_JSON or API failure, failing the step with a raw stack trace and no context. Wrap in try/catch and core.setFailed with the repo, PR_JSON length (parse vs truncation diagnosis without dumping the multi-KB PR body into logs), and error message. Still fails the step — assignment failures must stay visible, not warn-and-pass. Co-authored-by: multica-agent --- .github/workflows/release.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76da1e3..6bfff20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,13 +53,18 @@ jobs: with: github-token: ${{ steps.app-token.outputs.token }} script: | - const pr = JSON.parse(process.env.PR_JSON); - await github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - assignees: ['27Bslash6'], - }); + try { + const pr = JSON.parse(process.env.PR_JSON); + await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + assignees: ['27Bslash6'], + }); + core.info(`Assigned 27Bslash6 to release PR #${pr.number}`); + } catch (error) { + core.setFailed(`Failed to assign release PR in ${context.repo.owner}/${context.repo.repo} (PR_JSON length ${process.env.PR_JSON.length}): ${error.message}`); + } publish: needs: release-please