From 5d4dd3e38e624dffe850853fcc9fb5de38a36d58 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 12 Sep 2023 10:34:05 -0500 Subject: [PATCH] Set the target deployment to `main` during dispatched documentation deployments (#7304) Closes #7276 by deploying to production when not triggered by a pull request. --- .github/workflows/docs.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e25a8f27aaa97..22443cac89f96 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -51,4 +51,5 @@ jobs: with: apiToken: ${{ secrets.CF_API_TOKEN }} accountId: ${{ secrets.CF_ACCOUNT_ID }} - command: pages deploy site --project-name=ruff-docs --branch ${GITHUB_HEAD_REF} --commit-hash ${GITHUB_SHA} + # `github.head_ref` is only set during pull requests and for manual runs or tags we use `main` to deploy to production + command: pages deploy site --project-name=ruff-docs --branch ${{ github.head_ref || 'main' }} --commit-hash ${GITHUB_SHA}