semantic-release icon indicating copy to clipboard operation
semantic-release copied to clipboard

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

Open joshuabaird opened this issue 9 months ago • 0 comments

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 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!

joshuabaird avatar Feb 03 '25 18:02 joshuabaird