Skip to content

Commit e7a8dcf

Browse files
committed
show metadata as step
1 parent bcc226d commit e7a8dcf

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,29 @@ jobs:
4747
uses: actions/checkout@v2
4848
with:
4949
ref: ${{ env.HEAD_COMMIT }}
50-
# fetch-depth: 2
51-
- name: Get PR head SHA
52-
run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
50+
# We need to check out not only the fake merge commit between the PR and the base branch which GH creates, but
51+
# also its parents, so that we can pull the commit message from the head commit of the PR
52+
fetch-depth: 2
53+
# - name: Get PR head SHA
54+
# run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
5355
# - name: Setup tmate session
5456
# uses: mxschmitt/action-tmate@v3
55-
- name: Get commit message
57+
- name: Get metadata
5658
run: |
59+
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
5760
echo "COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
58-
- name: "BRANCH: ${{ github.ref_name }}"
61+
# - name: "BRANCH: ${{ github.ref_name }}"
62+
# run: echo ""
63+
- name: "Current commit: ${{ env.COMMIT_MESSAGE }} (${{ env.COMMIT_MESSAGE }})"
5964
run: echo ""
60-
- name: "COMMIT: ${{ env.COMMIT_MESSAGE }}"
61-
run: echo ""
62-
- name: "SHA: ${{ github.sha }}"
63-
run: echo ""
64-
- name: "GITHUB_HEAD_REF: ${{env.GITHUB_HEAD_REF}}"
65-
run: echo ""
66-
- name: Print env
67-
run: env | sort
68-
- name: Read variable
69-
run: echo "COMMIT_MESSAGE is ${{ env.COMMIT_MESSAGE }}"
65+
# - name: "SHA: ${{ github.sha }}"
66+
# run: echo ""
67+
# - name: "GITHUB_HEAD_REF: ${{env.GITHUB_HEAD_REF}}"
68+
# run: echo ""
69+
# - name: Print env
70+
# run: env | sort
71+
# - name: Read variable
72+
# run: echo "COMMIT_MESSAGE is ${{ env.COMMIT_MESSAGE }}"
7073

7174
- name: Set up Node
7275
uses: actions/setup-node@v1

0 commit comments

Comments
 (0)