This is an automated email from the ASF dual-hosted git repository.

jdaugherty pushed a commit to branch 5.0.x
in repository https://gitbox.apache.org/repos/asf/grails-redis.git


The following commit(s) were added to refs/heads/5.0.x by this push:
     new 3fa9db0  chore: add commit hash to release workflow for templates
3fa9db0 is described below

commit 3fa9db027ee6d4c26b03a10fa857afd908c22328
Author: James Daugherty <[email protected]>
AuthorDate: Wed Sep 3 19:56:34 2025 -0400

    chore: add commit hash to release workflow for templates
---
 .github/workflows/release.yml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 46fecd8..5dd726c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -33,6 +33,7 @@ jobs:
     outputs:
       release_version: ${{ steps.release_version.outputs.value }}
       extract_repository_name: ${{ 
steps.extract_repository_name.outputs.repository_name }}
+      commit_hash: ${{ steps.commit_hash.outputs.value }}
     steps:
       - name: "📝 Store the current release version"
         id: release_version
@@ -75,6 +76,25 @@ jobs:
         uses: apache/grails-github-actions/pre-release@asf
         env:
           RELEASE_VERSION: ${{ steps.release_version.outputs.value }}
+      - name: 'Fetch release Commit Hash'
+        id: commit_hash
+        env:
+          OWNER: ${{ github.repository_owner }}
+          REPO: ${{ steps.extract_repository_name.outputs.repository_name }}
+          TAG: 'v${{ steps.release_version.outputs.value }}'
+        run: |
+          ref_json=$(gh api "repos/$OWNER/$REPO/git/ref/tags/$TAG")
+
+          type=$(jq -r '.object.type' <<<"$ref_json")
+          sha=$(jq -r '.object.sha'  <<<"$ref_json")
+
+          if [ "$type" = "tag" ]; then
+            sha=$(gh api "repos/$OWNER/$REPO/git/tags/$sha" --jq '.object.sha')
+          fi
+
+          echo "Found Commit Sha: $sha"
+
+          echo "value=$sha" >>"$GITHUB_OUTPUT"
       - name: "📤 Publish to staging repository"
         env:
           GRAILS_PUBLISH_RELEASE: 'true'

Reply via email to