File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -34,22 +34,13 @@ jobs:
3434 PUPPET_GEM_VERSION : ${{ inputs.puppet_gem_version }}
3535
3636 steps :
37- # If we are on a PR, checkout the PR head sha, else checkout the default branch
38- # required when trigger set to pull_request_target
39- - name : " Set the checkout ref"
40- id : set_ref
41- run : |
42- if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
43- echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
44- else
45- echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT
46- fi
47-
4837 - name : " checkout"
4938 uses : " actions/checkout@v4"
5039 with :
5140 fetch-depth : 1
52- ref : ${{ steps.set_ref.outputs.ref }}
41+ # If we are on a PR, checkout the PR head sha, else checkout the default branch
42+ # required when trigger set to pull_request_target, ternary syntax is "${{ x && 'ifTrue' || 'ifFalse' }}"
43+ ref : ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
5344
5445 - name : " export environment"
5546 run : |
You can’t perform that action at this time.
0 commit comments