Skip to content

Conversation

@graycreate
Copy link
Member

Summary

Fixes the release changelog to use actual GitHub usernames (@graycreate) instead of git author names (@gray).

Problem

The release workflow was using %an in git log format, which returns the local git author name ("Gray Zhang") rather than the GitHub username. This caused releases to show incorrect contributor attributions.

Solution

  • Modified the changelog generation to use GitHub API to fetch actual GitHub usernames
  • Falls back to git author name if API call fails
  • Ensures proper @mentions in release notes

Changes

  • Updated .github/workflows/release.yml changelog generation step
  • Added function to query GitHub API for commit author username
  • Maintains backward compatibility with fallback

Testing

This fix ensures future releases will correctly show:

  • @graycreate instead of @Gray
  • Proper GitHub username attribution in changelog

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

- Replace %an (git author name) with actual GitHub username via API
- Falls back to git author name if API call fails
- Ensures @graycreate appears instead of @gray in release notes
Copilot AI review requested due to automatic review settings September 10, 2025 00:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes release changelog generation to use GitHub usernames instead of git author names for proper attribution in release notes.

  • Replaces simple git log formatting with GitHub API calls to fetch actual usernames
  • Adds fallback mechanism to git author names when API calls fail
  • Implements the fix for both scenarios: when a previous tag exists and when generating changelog from recent commits

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

get_github_username() {
local commit_sha="$1"
# Try to get the GitHub username from the commit using gh api
local username=$(gh api "repos/${{ github.repository }}/commits/${commit_sha}" --jq '.author.login // .commit.author.name' 2>/dev/null || echo "")
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

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

The jq expression .author.login // .commit.author.name will return the commit author name instead of GitHub username when .author.login is null. This defeats the purpose of the API call since .commit.author.name is the same as what the git fallback provides. Consider using .author.login // empty to only return GitHub usernames or nothing.

Copilot uses AI. Check for mistakes.
echo "@$username"
else
# Fallback to git author name if API fails
echo "$(git show -s --format='%an' $commit_sha)"
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

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

The fallback should be consistent with the original behavior which used @%an format. The fallback is missing the @ prefix that was present in the original implementation.

Copilot uses AI. Check for mistakes.
- Remove unnecessary info text file generation and upload
- Keep only the signed APK upload to GitHub release
- Simplifies release artifacts
- Use '.author.login // empty' instead of redundant fallback to .commit.author.name
- Add @ prefix to git author name fallback for consistency with original format
- Ensures cleaner logic flow and consistent @ prefixes in changelog
@graycreate graycreate merged commit d503305 into main Sep 10, 2025
5 checks passed
@graycreate graycreate deleted the feature/auto-version-tagging branch September 10, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants