Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ jobs:

- name: Generate changelog
id: changelog
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "## What's Changed" > CHANGELOG.md
echo "" >> CHANGELOG.md
Expand All @@ -361,8 +363,26 @@ jobs:
if [ -n "$username" ]; then
echo "@$username"
else
# Fallback to git author name if API fails
echo "@$(git show -s --format='%an' $commit_sha)"
# Fallback: try to get committer login if author login is not available
local committer=$(gh api "repos/${{ github.repository }}/commits/${commit_sha}" --jq '.committer.login // empty' 2>/dev/null || echo "")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub API call for committer.login duplicates the repository and commit SHA parameters from the author lookup above. Consider extracting the API call logic into a reusable function to avoid repetition and improve maintainability.

Copilot uses AI. Check for mistakes.
if [ -n "$committer" ]; then
echo "@$committer"
else
# Last resort: use hardcoded mapping for known authors
local git_author=$(git show -s --format='%an' $commit_sha)
case "$git_author" in
"Gray Zhang" | "gray" | "Gray")
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The hardcoded mapping includes multiple variations of the same author name. Consider whether all these variations ('gray', 'Gray') are actually needed in practice, as they may create confusion and maintenance overhead.

Suggested change
"Gray Zhang" | "gray" | "Gray")
# Only the canonical author name is mapped; add more if needed in the future
"Gray Zhang")

Copilot uses AI. Check for mistakes.
echo "@graycreate"
;;
"github-actions[bot]")
echo "@github-actions[bot]"
;;
*)
# If no mapping found, use git author name without @
echo "$git_author"
;;
esac
fi
fi
}

Expand Down
Loading