Skip to content

Commit 5ddf8ed

Browse files
authored
Merge pull request #1159 from jdaugherty/7.0.x
ci: add commit hash for vote templates
2 parents 1b11f77 + aaef846 commit 5ddf8ed

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
outputs:
3434
release_version: ${{ steps.release_version.outputs.value }}
3535
extract_repository_name: ${{ steps.extract_repository_name.outputs.repository_name }}
36+
commit_hash: ${{ steps.commit_hash.outputs.value }}
3637
steps:
3738
- name: "📝 Store the current release version"
3839
id: release_version
@@ -75,6 +76,25 @@ jobs:
7576
uses: apache/grails-github-actions/pre-release@asf
7677
env:
7778
RELEASE_VERSION: ${{ steps.release_version.outputs.value }}
79+
- name: 'Fetch release Commit Hash'
80+
id: commit_hash
81+
env:
82+
OWNER: ${{ github.repository_owner }}
83+
REPO: ${{ steps.extract_repository_name.outputs.repository_name }}
84+
TAG: 'v${{ steps.release_version.outputs.value }}'
85+
run: |
86+
ref_json=$(gh api "repos/$OWNER/$REPO/git/ref/tags/$TAG")
87+
88+
type=$(jq -r '.object.type' <<<"$ref_json")
89+
sha=$(jq -r '.object.sha' <<<"$ref_json")
90+
91+
if [ "$type" = "tag" ]; then
92+
sha=$(gh api "repos/$OWNER/$REPO/git/tags/$sha" --jq '.object.sha')
93+
fi
94+
95+
echo "Found Commit Sha: $sha"
96+
97+
echo "value=$sha" >>"$GITHUB_OUTPUT"
7898
- name: "📤 Publish to staging repository"
7999
env:
80100
GRAILS_PUBLISH_RELEASE: 'true'

0 commit comments

Comments
 (0)