From a9792eca7e26e423589d30d2b766c302b7ee6a63 Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Fri, 26 Apr 2024 16:44:34 -0700 Subject: [PATCH 1/2] Update the upload job The current regex doesn't match as needed, but the corrected one does. Also exporting the GITHUB_REF variable just in case. --- .github/workflows/doc-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index ccc852c24fb..a3ea6d5ebc3 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -95,10 +95,11 @@ jobs: # If matches a tag like refs/tags/v1.12.0-rc3 or # refs/tags/v1.12.0 convert to 1.12 GITHUB_REF=${{ github.ref }} + export GITHUB_REF=${{ github.ref }} # Convert refs/tags/v1.12.0rc3 into 1.12. # Adopted from https://github.com/pytorch/pytorch/blob/main/.github/workflows/_docs.yml#L150C11-L155C13 - if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\\.[0-9]+)\\. ]]; then + if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+)\.* ]]; then TARGET_FOLDER="${BASH_REMATCH[1]}" else TARGET_FOLDER="main" From 9e8846ec6f6a09b6ea5cfd855c2c2c1f6ffb6c8d Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Fri, 26 Apr 2024 17:16:26 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Dave Bort --- .github/workflows/doc-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index a3ea6d5ebc3..7a3b862b217 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -94,12 +94,11 @@ jobs: # Get github.ref for the output doc folder. By default "main" # If matches a tag like refs/tags/v1.12.0-rc3 or # refs/tags/v1.12.0 convert to 1.12 - GITHUB_REF=${{ github.ref }} export GITHUB_REF=${{ github.ref }} # Convert refs/tags/v1.12.0rc3 into 1.12. # Adopted from https://github.com/pytorch/pytorch/blob/main/.github/workflows/_docs.yml#L150C11-L155C13 - if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+)\.* ]]; then + if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+) ]]; then TARGET_FOLDER="${BASH_REMATCH[1]}" else TARGET_FOLDER="main"