diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 4132604..1618088 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -30,6 +30,30 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Collect release notes + id: release-notes + run: | + set -euo pipefail + + if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then + RANGE="${{ github.event.before }}..${{ github.sha }}" + else + RANGE="-5" + fi + + NOTES="$(git log "$RANGE" --pretty=format:'- %h %s' --no-merges | head -20)" + if [ -z "$NOTES" ]; then + NOTES="$(git log -1 --pretty=format:'- %h %s')" + fi + + { + echo "notes<> "$GITHUB_OUTPUT" - name: Setup Go uses: actions/setup-go@v5 @@ -187,6 +211,8 @@ jobs: Commit: ${{ github.sha }} Actor: ${{ github.actor }} Image: ${{ env.IMAGE_NAME }}:${{ github.sha }} + Updates: + ${{ steps.release-notes.outputs.notes }} Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} EOF )" @@ -213,6 +239,8 @@ jobs: Commit: ${{ github.sha }} Actor: ${{ github.actor }} Image: ${{ env.IMAGE_NAME }}:${{ github.sha }} + Updates: + ${{ steps.release-notes.outputs.notes }} Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} EOF )"