Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Update release notes format in Github Actions
Browse files Browse the repository at this point in the history
JQ command used in Github workflow for retrieving commit data in release.yml file has been modified. Instead of just printing the commit message, it now formats each commit into a markdown list item comprising a short SHA, the commit message, the committer name, and the commit date in order to improve clarity and easy navigation. This is followed by a newline for better readability.
  • Loading branch information
sopyb committed Sep 11, 2023
1 parent 02c5be9 commit bf0dead
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: |
data=$(curl --silent --show-error --location --fail --retry 3 --header "Authorization: Bearer $GITHUB_TOKEN" --header "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/compare/${{ env.tag }}...${{ github.sha }}")
echo "$data"
commits=$(echo "$data" | jq -r '.commits | map(".commit.message") | join( "\n\n")')
commits=$(echo "$data" | jq -r '.commits | map("* [`" + .sha[0:7] + "`](" + "https://github.com/${{ github.repository }}/commit/" + .sha + ") - " + .commit.message + " by " + .commit.committer.name + " at " + .commit.committer.date) | join("\n\n")')
prev_commit=$(echo "$data" | jq -r '.base_commit.sha' | cut -c -7)
current_commit=$(echo "${{ github.sha }}" | cut -c -7)
echo "notes=$commits" >> $GITHUB_ENV
Expand All @@ -66,6 +66,7 @@ jobs:
release_name: Release ${{ env.version }}
body: |
Release based on commit ${{ github.sha }}
Changes:
${{ env.notes }}
Expand Down

0 comments on commit bf0dead

Please sign in to comment.