webatintel / aquarium

BSD 3-Clause "New" or "Revised" License
24 stars 7 forks source link

Fix potential commit SHA validation failure #128

Closed hujiajie closed 4 years ago

hujiajie commented 4 years ago

The GITHUB_SHA environment variable, or the github.sha expression in the workflow file, gives the SHA that triggered the workflow run. According to

https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request

for a pull_request event, this commit is the merge of the PR and the base branch, BUT NOT NECESSARILY THE SAME AS refs/pull/:prNumber/merge. If the commit is unreachable from any remote refs, there would be no way to fetch it via git-clone, so the SHA cannot be understood in local. Nevertheless, the main use of this merge commit is to find its parents, whose SHAs can alternatively be obtained by making GraphQL queries (https://docs.github.com/en/graphql).

gyagp commented 4 years ago

rubber stamp LGTM