Skip to content

Commit 0a5d33a

Browse files
committed
fix: print correct commit hash
1 parent 5ae4470 commit 0a5d33a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
run: make hash
8585

8686
- name: Commit Hash
87-
run: echo ${GITHUB_SHA}
87+
run: echo ${{ github.event.pull_request.head.sha }}
8888

8989
measure:
9090
runs-on: ubuntu-latest

.github/workflows/test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,5 @@ jobs:
7575
run: make hash
7676

7777
- name: Commit Hash
78-
run: echo ${GITHUB_SHA}
78+
run: echo ${{ github.event.pull_request.head.sha }}
79+

scripts/check-contract-hash.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ make build-in-docker
1313
commit_hash=$(openssl dgst -sha256 "$commit" | awk '{print $2}')
1414
docker_hash=$(openssl dgst -sha256 "$docker" | awk '{print $2}')
1515

16+
git_hash=$(git rev-parse --short "$GITHUB_SHA")
17+
git_branch=${GITHUB_REF#refs/heads/}
18+
19+
echo "$git_hash"
20+
echo "$git_branch"
21+
1622
if [ "$commit_hash" = "$docker_hash" ]; then
17-
echo "Binary hashes match. Commit hash: ${GITHUB_SHA}"
23+
echo "Binary hashes match."
1824
else
1925
echo "The contract in commit hash does not match with hash of contract build in docker. You must call \`make dock\` command before submitting a PR." >&2
2026
exit 1

0 commit comments

Comments
 (0)