Skip to content

Commit

Permalink
Merge pull request #87 from puppetlabs/maint-update_checkout_ref_gem_ci
Browse files Browse the repository at this point in the history
(bug) - Fix broken conditional on windows
  • Loading branch information
david22swan authored May 2, 2024
2 parents ff20433 + 2e3a3fb commit 2a8f96d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/gem_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,13 @@ jobs:
PUPPET_GEM_VERSION: ${{ inputs.puppet_gem_version }}

steps:
# If we are on a PR, checkout the PR head sha, else checkout the default branch
# required when trigger set to pull_request_target
- name: "Set the checkout ref"
id: set_ref
run: |
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
else
echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT
fi
- name: "checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 1
ref: ${{ steps.set_ref.outputs.ref }}
# If we are on a PR, checkout the PR head sha, else checkout the default branch
# required when trigger set to pull_request_target, ternary syntax is "${{ x && 'ifTrue' || 'ifFalse' }}"
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: "export environment"
run: |
Expand Down

0 comments on commit 2a8f96d

Please sign in to comment.