Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joshuabaird opened this issue Feb 3, 2025 · 0 comments
Open

Comments

@joshuabaird
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant