Skip to content

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

@joshuabaird

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions