Skip to content

Commit 355b2ae

Browse files
owineclaude
andcommitted
refactor(deploy): replace GitHub API curl with gh CLI for commit message
Replaces direct curl call to GitHub API with gh CLI for fetching commit messages in Discord notifications. Benefits: - Automatic authentication via GH_TOKEN (no manual Authorization header) - Built-in --jq flag for JSON parsing - More idiomatic for GitHub Actions workflows - Simpler and more maintainable code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a70a6a0 commit 355b2ae

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -819,14 +819,11 @@ jobs:
819819

820820
- name: Get commit message
821821
id: commit-msg
822+
env:
823+
GH_TOKEN: ${{ github.token }}
822824
run: |
823-
COMMIT_MSG=$(curl -s \
824-
--connect-timeout 10 \
825-
--max-time 30 \
826-
-H "Authorization: token ${{ github.token }}" \
827-
"https://api.github.com/repos/${{ github.repository }}/commits/${{ inputs.target-ref }}" \
828-
| jq -r '.commit.message // "No commit message available"' \
829-
| head -1)
825+
COMMIT_MSG=$(gh api repos/${{ github.repository }}/commits/${{ inputs.target-ref }} \
826+
--jq '.commit.message // "No commit message available"' | head -1)
830827
SHORT_SHA="${{ inputs.target-ref }}"
831828
SHORT_SHA="${SHORT_SHA:0:7}"
832829
echo "message=$COMMIT_MSG" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)