Skip to content

Commit 481cc60

Browse files
authored
fix: fix document preview pipeline for forked PRs (#950)
The checkout actions uses ref as `github.sha` by default. For forked repos, this refers to the last commit on the main branch ([ref](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#fork)). This means that the docs preview pipeline when run on forked PRs does not allow us to preview changes made in the PR. `github.event.pull_request.head.sha` allows to to checkout the latest commit on the forked PR.
1 parent d16728e commit 481cc60

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎.github/workflows/docs_preview_deploy.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
5353
with:
54+
# Checkout the PR's HEAD commit (supports forks).
55+
ref: ${{ github.event.pull_request.head.sha }}
5456
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
5557

5658
- name: Setup Hugo

0 commit comments

Comments
 (0)