Skip to content

Commit 4cd780e

Browse files
ci: add error handling to release-PR assign script (LAB-899)
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@multica.ai>
1 parent 2ab42cc commit 4cd780e

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,18 @@ jobs:
5353
with:
5454
github-token: ${{ steps.app-token.outputs.token }}
5555
script: |
56-
const pr = JSON.parse(process.env.PR_JSON);
57-
await github.rest.issues.addAssignees({
58-
owner: context.repo.owner,
59-
repo: context.repo.repo,
60-
issue_number: pr.number,
61-
assignees: ['27Bslash6'],
62-
});
56+
try {
57+
const pr = JSON.parse(process.env.PR_JSON);
58+
await github.rest.issues.addAssignees({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
issue_number: pr.number,
62+
assignees: ['27Bslash6'],
63+
});
64+
core.info(`Assigned 27Bslash6 to release PR #${pr.number}`);
65+
} catch (error) {
66+
core.setFailed(`Failed to assign release PR in ${context.repo.owner}/${context.repo.repo} (PR_JSON length ${process.env.PR_JSON.length}): ${error.message}`);
67+
}
6368
6469
publish:
6570
needs: release-please

0 commit comments

Comments
 (0)