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

Add support for commitish to target specific commit #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gnoeou
Copy link

@gnoeou gnoeou commented Apr 7, 2021

Added support for specifying a commit to tag. See actions/create-release#32 for details

@TobiasBales
Copy link

Any chance on this happening?
At the moment this is broken for us if you merge multiple prs in quick succession and this could fix it

@gnoeou
Copy link
Author

gnoeou commented Apr 16, 2021

I've not received any feedback on the request.

@anzz1
Copy link

anzz1 commented Aug 8, 2023

This looks like to be a duplicate of

with minor differences.

Have not tested this one, but that other PR is confirmed to work correctly and I've personally used it extensively.

Whichever one ultimately gets merged doesn't matter, just that one eventually does. The main selling point of this feature isn't the ability to manually target some specific commit (which is nice to have too), but that the release matches the commit the action was ran on.

The current system of tagging and creating the release always from the latest commit on the master branch is broken, as it's impossible to use this action in any other branches than master or create releases from older commits than the very latest one.
Also like @TobiasBales mentioned, it can also break when the intention is only to ever use the master branch and create releases from the latest commit.

Example situation:

  1. You have a workflow which builds the project, creates a release and uploads binaries to the release, triggered when commit is pushed to master.
  2. You push commits A, B, C in order to master in a quick succession. Actions get triggered on each one of them, in parallel, with no guarantee that the actions will finish or even start in the same chronological order.
  3. A finishes first, but C is the latest commit and gets tagged as v1.0.0 , binaries from A gets uploaded.
  4. B and C finish in whichever order, both try to tag C as v1.0.1 which fails as the tag already exists.
  5. A and B are left untagged and unreleased, C is released as v1.0.0 with binaries from A.

Using the commitish from the action's context, in other words merging the PR, fixes all this.

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

Successfully merging this pull request may close these issues.

None yet

3 participants