Skip to content

Commit c655a73

Browse files
authored
Check out head_ref of source branch on PRs (#188)
1 parent d1afe7b commit c655a73

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/render.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ jobs:
4848
echo OUTPUT_FILENAME="${filename}" >> "$GITHUB_OUTPUT"
4949
echo output filename: ${filename}
5050
51+
# For pull requests, check out the head ref of the source branch.
5152
- name: Checkout
53+
if: inputs.workflow == 'pr'
54+
uses: actions/checkout@v4
55+
with:
56+
ref: ${{ github.head_ref }}
57+
fetch-depth: 0
58+
fetch-tags: true
59+
# For other workflows, check out the requested revision (which defaults to
60+
# head of the default branch).
61+
- name: Checkout
62+
if: inputs.workflow != 'pr'
5263
uses: actions/checkout@v4
5364
with:
5465
ref: ${{ inputs.revision }}

0 commit comments

Comments
 (0)