Skip to content

Commit 5d4dd3e

Browse files
authored
Set the target deployment to main during dispatched documentation deployments (#7304)
Closes #7276 by deploying to production when not triggered by a pull request.
1 parent e561f57 commit 5d4dd3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/docs.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ jobs:
5151
with:
5252
apiToken: ${{ secrets.CF_API_TOKEN }}
5353
accountId: ${{ secrets.CF_ACCOUNT_ID }}
54-
command: pages deploy site --project-name=ruff-docs --branch ${GITHUB_HEAD_REF} --commit-hash ${GITHUB_SHA}
54+
# `github.head_ref` is only set during pull requests and for manual runs or tags we use `main` to deploy to production
55+
command: pages deploy site --project-name=ruff-docs --branch ${{ github.head_ref || 'main' }} --commit-hash ${GITHUB_SHA}

0 commit comments

Comments
 (0)