From e3a7b4b8bda01ae1b8a5406586ed9cc007bdc8c5 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 30 Apr 2026 17:43:21 +0000 Subject: [PATCH 1/2] Use REST API for release draft labels --- .github/workflows/release-draft.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index aff86cd..6c3b399 100644 --- a/.github/workflows/release-draft.yml +++ b/.github/workflows/release-draft.yml @@ -147,18 +147,24 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh issue edit ${{ github.event.pull_request.number }} \ - --repo "$GITHUB_REPOSITORY" \ - --add-label "breaking-change-analyzed" + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/labels" \ + -f labels[]="breaking-change-analyzed" \ + --silent - name: Add breaking-change label if applicable if: steps.analysis.outputs.has_breaking_changes == 'true' env: GH_TOKEN: ${{ github.token }} run: | - gh issue edit ${{ github.event.pull_request.number }} \ - --repo "$GITHUB_REPOSITORY" \ - --add-label "breaking-change" + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/labels" \ + -f labels[]="breaking-change" \ + --silent - name: Post analysis result to PR env: From 0cc86672ac7f7dd5b0587aca0f13d951e66ef14e Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 30 Apr 2026 17:45:10 +0000 Subject: [PATCH 2/2] Use REST API for release draft comments --- .github/workflows/release-draft.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index 6c3b399..0761bee 100644 --- a/.github/workflows/release-draft.yml +++ b/.github/workflows/release-draft.yml @@ -192,9 +192,16 @@ jobs: printf '*This analysis was performed by Claude Code Action*\n' } > "$TMPFILE" - gh issue comment ${{ github.event.pull_request.number }} \ - --repo "$GITHUB_REPOSITORY" \ - --body-file "$TMPFILE" + TMPJSON=$(mktemp) + trap 'rm -f "$TMPFILE" "$TMPJSON"' EXIT + jq -n --rawfile body "$TMPFILE" '{body: $body}' > "$TMPJSON" + + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + "/repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/comments" \ + --input "$TMPJSON" \ + --silent - name: Calculate version and update draft release env: