mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-12 00:49:08 -05:00
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.
This commit is contained in:
2
.github/workflows/docs_preview_deploy.yaml
vendored
2
.github/workflows/docs_preview_deploy.yaml
vendored
@@ -51,6 +51,8 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
with:
|
||||
# Checkout the PR's HEAD commit (supports forks).
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
|
||||
Reference in New Issue
Block a user