Skip to content

Commit

Permalink
ci: fix tags not pointing to release commits (#70)
Browse files Browse the repository at this point in the history
Until now, the release tags always pointed to the last commit before
the actual release (the commit including the galaxy.yml and CHANGELOG.md)
update, apparently due to the create-release action using the last commithash
at the time of checkout, which happens at the beginning of the workflow,
thus ignoring the new release commit. This commit fixes that behavior
by explicitly setting the commit hash to the hash of the release commit.
  • Loading branch information
maxhoesel authored Jun 22, 2021
1 parent abc9b66 commit 7dc8913
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ jobs:
./tmp-chglog/git-chglog --next-tag v${{ github.event.inputs.version }} --output ./CHANGELOG.md
rm -rf tmp-chglog
- name: Commit and push Release
- name: Create and push Release commit
run: |
git add CHANGELOG.md
git add galaxy.yml
git commit -m "Release ${{ github.event.inputs.version }}"
git push
- name: Get release commit hash
run: echo "release_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Build Ansible Collection
run: ansible-galaxy collection build --force

Expand All @@ -60,6 +63,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
commitish: ${{ env.release_hash }}
release_name: ${{ github.event.inputs.version }}
draft: false
prerelease: false
Expand Down

0 comments on commit 7dc8913

Please sign in to comment.