From 37b25494af1a69deb47ecbf933a2fe715fbd14c7 Mon Sep 17 00:00:00 2001 From: Taylor Baldwin Date: Thu, 15 Aug 2024 16:13:40 -0400 Subject: [PATCH] more reliable way of getting the git commit message (#9) --- action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 8918525..69f4998 100644 --- a/action.yml +++ b/action.yml @@ -55,6 +55,12 @@ runs: username: ${{ env.JAMCR_USER }} password: ${{ env.JAMCR_PASS }} + - name: Get commit message + shell: bash + run: | + COMMIT_MSG=$(git log -1 --pretty=%B) + echo "COMMIT_MSG=$COMMIT_MSG" >> $GITHUB_ENV + - name: Extract Docker metadata id: meta uses: docker/metadata-action@v5 @@ -64,7 +70,7 @@ runs: type=raw,value=${{ inputs.tag }} labels: | hash=${{ github.sha }} - message=${{ github.event.head_commit.message }} + message=${{ env.COMMIT_MSG }} branch=${{ github.ref_name }} repository=${{ github.repository }}