Skip to content

Commit a69595e

Browse files
committed
Add trigger event sha
1 parent 2d89c48 commit a69595e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ env:
2121
LINUX_BOOT_FILES_PATH: ${{ github.workspace }}/LinuxBootFiles
2222

2323
jobs:
24+
find-sha:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Find SHA of the triggering workflow (i.e. PR)
28+
run: |
29+
if [ "$EVENT" == 'pull_request' ]
30+
then
31+
echo "::set-output name=sha::$(echo ${{github.event.pull_request.head.sha}})"
32+
elif [ "$EVENT" == 'workflow_run' ]
33+
then
34+
echo "::set-output name=sha::$(echo ${{github.event.workflow_run.head_sha}})"
35+
else
36+
echo "::set-output name=sha::$(echo $GITHUB_SHA)"
37+
fi
38+
env:
39+
EVENT: ${{ github.event_name }}
40+
REF: ${{ github.ref }}
41+
2442
lint:
2543
runs-on: "windows-2022"
2644
strategy:

0 commit comments

Comments
 (0)