Skip to content

Commit

Permalink
Add trigger event sha
Browse files Browse the repository at this point in the history
  • Loading branch information
jiechen0826 committed Feb 18, 2025
1 parent 2d89c48 commit a69595e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ env:
LINUX_BOOT_FILES_PATH: ${{ github.workspace }}/LinuxBootFiles

jobs:
find-sha:
runs-on: ubuntu-latest
steps:
- name: Find SHA of the triggering workflow (i.e. PR)
run: |
if [ "$EVENT" == 'pull_request' ]
then
echo "::set-output name=sha::$(echo ${{github.event.pull_request.head.sha}})"
elif [ "$EVENT" == 'workflow_run' ]
then
echo "::set-output name=sha::$(echo ${{github.event.workflow_run.head_sha}})"
else
echo "::set-output name=sha::$(echo $GITHUB_SHA)"
fi
env:
EVENT: ${{ github.event_name }}
REF: ${{ github.ref }}

lint:
runs-on: "windows-2022"
strategy:
Expand Down

0 comments on commit a69595e

Please sign in to comment.