-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make checked out ref available to other steps #281
Comments
Although it assumes the sources were fetched using git (mainline). However when git 2.18 or higher isn't in the PATH, the tarball is downloaded instead. |
Exactly, so that's why that would only be a partial solution 😄 I think it also won't work in for example some Docker based tasks (unless the containers ship git). And obviously you need to execute the command in the work dir. |
Looks like the short SHA is readily available: checkout/src/github-api-helper.ts Line 59 in 61b9e37
But getting the full one would require an API call I suppose? |
+1 for having the commit as an output of the action. |
I've opened #1180 to output |
That is already available as |
This is now available in https://github.com/actions/checkout/releases/tag/v4.2.0 |
Pull requests events by default check out the merge commit ref. Alternatively, the pull request head can be checkout using:
However, in successive actions it is not possible to detect whether the action uses another ref.
github.context.sha
still references the merge commit. See for example the discussion on: jwgmeligmeyling/pmd-github-action#2It would be nice if
actions/checkout@v2
somehow made the checkout ref available as output or exported variable.Or am I overlooking an existing approach to obtain the checked out commit SHA?
The text was updated successfully, but these errors were encountered: