Skip to content

Commit 007297e

Browse files
authored
Merge pull request #871 from puppetlabs/pdksync_cat-770-run_mend_on_prs
pdksync - (CAT-770) - Update mend to run on pull_request_target
2 parents 481e583 + c48d525 commit 007297e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/mend.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@ on:
66
pull_request_target:
77
types:
88
- opened
9+
- synchronize
910
workflow_dispatch:
1011

1112
jobs:
1213
mend:
1314
runs-on: ubuntu-latest
1415
steps:
16+
# If we are on a PR, checkout the PR head sha, else checkout the default branch
17+
- name: "Set the checkout ref"
18+
id: set_ref
19+
run: |
20+
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
21+
echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
22+
else
23+
echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT
24+
fi
25+
1526
- uses: actions/checkout@v4
27+
with:
28+
ref: ${{ steps.set_ref.outputs.ref }}
1629

1730
- name: 'setup node: 18 platform: ${{ runner.os }}'
1831
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)