File tree 1 file changed +3
-12
lines changed
1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -34,22 +34,13 @@ jobs:
34
34
PUPPET_GEM_VERSION : ${{ inputs.puppet_gem_version }}
35
35
36
36
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
-
48
37
- name : " checkout"
49
38
uses : " actions/checkout@v4"
50
39
with :
51
40
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 }}
53
44
54
45
- name : " export environment"
55
46
run : |
You can’t perform that action at this time.
0 commit comments