Skip to content

Commit 26111e6

Browse files
committed
get PR head SHA
1 parent d61ce3f commit 26111e6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ jobs:
4747
uses: actions/checkout@v2
4848
with:
4949
ref: ${{ env.HEAD_COMMIT }}
50-
fetch-depth: 5
50+
fetch-depth: 2
51+
- name: Get PR head SHA
52+
run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
5153
- name: Setup tmate session
5254
uses: mxschmitt/action-tmate@v3
5355
- name: Get commit message
5456
run: |
5557
git rev-parse $GITHUB_HEAD_REF
56-
echo "COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s $(git rev-parse $GITHUB_HEAD_REF))" >> $GITHUB_ENV
58+
echo "COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
5759
- name: "BRANCH: ${{ github.ref_name }}"
5860
run: echo ""
5961
- name: "COMMIT: ${{ env.COMMIT_MESSAGE }}"

0 commit comments

Comments
 (0)