We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ecb6a90 + 27ef930 commit ff20433Copy full SHA for ff20433
.github/workflows/gem_ci.yml
@@ -34,9 +34,22 @@ jobs:
34
PUPPET_GEM_VERSION: ${{ inputs.puppet_gem_version }}
35
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
- name: "checkout"
49
uses: "actions/checkout@v4"
50
+ with:
51
+ fetch-depth: 1
52
+ ref: ${{ steps.set_ref.outputs.ref }}
53
54
- name: "export environment"
55
run: |
0 commit comments