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

Action doesn't seem to get the right revision value #29

Closed
jbanulso opened this issue Dec 11, 2020 · 6 comments · Fixed by #31
Closed

Action doesn't seem to get the right revision value #29

jbanulso opened this issue Dec 11, 2020 · 6 comments · Fixed by #31

Comments

@jbanulso
Copy link

Hi,

I'm trying to use this action in our workflows to get PR checks and detailed information on runs for each commit, however I can't seem to get this work.

I get this from the logs:

Gathering inputs
  Using git revision [SHA]

However that SHA is not the last commit SHA on my PR, but rather a SHA of a "detached HEAD state", which I can confirm if I try to visit the url of that SHA in github.com, I get a warning saying "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository".

Am I doing something fundamentally wrong? I am using the action as in the example in the README.

@gcooney
Copy link
Contributor

gcooney commented Dec 11, 2020

@jbanulso Can you share the trigger for the workflow. Are you triggering on [push] or [pull_request]?

@jbanulso
Copy link
Author

It's like this:

on:
  pull_request:
    types: [ opened, synchronize, reopened ]
  workflow_dispatch:

@gcooney
Copy link
Contributor

gcooney commented Dec 11, 2020

Ok, it looks like the GITHUB_SHA environment variable isn't the HEAD commit of the branch for action type pull_request: https://github.community/t/github-sha-not-the-same-as-the-triggering-commit/18286
https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch

We will work on a fix to grab the SHA of the tip commit on the branch a different way.

@gcooney
Copy link
Contributor

gcooney commented Dec 11, 2020

Thanks for the report!

@jbanulso
Copy link
Author

No problem, thank you for looking into it. And for the record, it works fine when the trigger is on: [push]

@gcooney
Copy link
Contributor

gcooney commented Dec 21, 2020

@jbanulso This fix was released last week. Let us know if you are still seeing issues.

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

Successfully merging a pull request may close this issue.

2 participants