Ability to commit (and include) a file before the release gets tagged

#188 · open · 1 comments

View on GitHub ↗

joshuabaird

As part of my release process, I need to push a commit that updates a file to reference the new version. This needs to happen before semantic-release cuts a new tag so that it is included in the tag/release. My workflow is something like this: ``` - name: Determine release version uses: go-semantic-release/action@v1 id: determine-release-version with: # Do not actually release anything, just generate the next version # so that we can use it in future steps dry: true github-token: ${{ secrets.GITHUB_TOKEN }} - name: Generate version file run: | echo ${{ steps.determine-release-version.outputs.version }} > VERSION git add VERSION git commit -m 'Ref tag: ${{ steps.determine-release-version.outputs.version }} - name: Cut release uses: go-semantic-release/action@v1 ``` The issue that I'm having is that [because semantic-release uses](https://github.com/go-semantic-release/condition-github/blob/778881d496391703b612c21b131f401f7015aa6d/pkg/condition/github.go#L25) `GITHUB_SHA` to determine the SHA, my commit is not getting included in the release. `GITHUB_SHA` (for `on push` events) will always return the commit SHA that _triggered_ the workflow, not the SHA of the latest commit. @christophwitzko Do you have any ideas on how I could make this work? Thanks!

Comments

ianhundere

@joshuabaird opened a PR for this