Skip to content

Commit

Permalink
fix: checkout-verif uses wrong sha to validate for pull_requests (#941)
Browse files Browse the repository at this point in the history
* update

* update
  • Loading branch information
laurentsimon authored Sep 30, 2022
1 parent b075c0c commit fc65005
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/actions/verify-checkout/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ runs:
shell: bash
env:
CONTEXT: "${{ toJSON(github) }}"
PULL_REQUEST_SHA: "${{ github.event.pull_request.head.sha }}"
run: |
set -euo pipefail
git_sha=$(git log -1 --format='%H')
if [[ "$git_sha" != "$GITHUB_SHA" ]]; then
echo "mismatch git sha \"$git_sha\" != \"$GITHUB_SHA\""
git_sha="$(git log -1 --format='%H')"
github_sha="$GITHUB_SHA"
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
github_sha="$PULL_REQUEST_SHA"
fi
if [[ "$git_sha" != "$github_sha" ]]; then
echo "mismatch git sha \"$git_sha\" != \"$github_sha\""
echo "GitHub context:"
echo "$CONTEXT"
echo
Expand Down

0 comments on commit fc65005

Please sign in to comment.