Fetch commit details from GitHub API instead to get proper usernames

This commit is contained in:
arkon 2021-01-24 11:03:45 -05:00
parent d97baea8fc
commit 7b23fbaeae

View File

@ -51,14 +51,19 @@ jobs:
commit_count=$(git rev-list --count HEAD) commit_count=$(git rev-list --count HEAD)
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV
echo "CURRENT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV current_sha=$(git rev-parse --short HEAD)
echo "CURRENT_SHA=$current_sha" >> $GITHUB_ENV
prev_commit_count=$(echo "${{ steps.last_release.outputs.tag_name }}" | sed -e "s/^r//") prev_commit_count=$(echo "${{ steps.last_release.outputs.tag_name }}" | sed -e "s/^r//")
commit_count_diff=$(expr $commit_count - $prev_commit_count) commit_count_diff=$(expr $commit_count - $prev_commit_count)
echo "PREV_RELEASE_SHA=$(git rev-parse --short HEAD~$commit_count_diff)" >> $GITHUB_ENV prev_release_sha=$(git rev-parse --short HEAD~$commit_count_diff)
echo "PREV_RELEASE_SHA=$prev_release_sha" >> $GITHUB_ENV
echo "COMMIT_LOGS<<{delimiter} echo "COMMIT_LOGS<<{delimiter}
$(git log HEAD~$commit_count_diff..HEAD --reverse --pretty=format:'- %s (@%an)') $(curl -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/tachiyomiorg/tachiyomi/compare/$prev_release_sha...$current_sha" \
| jq '[.commits[]|{message:(.commit.message | split("\n")), username:.author.login}]' \
| jq -r '.[]|"- \(.message | first) (@\(.username))"')
{delimiter}" >> $GITHUB_ENV {delimiter}" >> $GITHUB_ENV
- name: Set up keystore - name: Set up keystore