Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
Loading