Skip to content

Commit 8f41f1a

Browse files
authored
Avoid red doc job on RC push (meta-pytorch#1479)
1 parent 513d73b commit 8f41f1a

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ jobs:
295295

296296
needs: build-docs
297297
if: github.repository == 'meta-pytorch/torchcodec' && github.event_name == 'push' &&
298-
((github.ref_type == 'branch' && github.ref_name == 'main') || github.ref_type == 'tag')
298+
((github.ref_type == 'branch' && github.ref_name == 'main') ||
299+
(github.ref_type == 'tag' && !contains(github.ref_name, '-rc')))
299300
runs-on: ubuntu-latest
300301
steps:
301302
- name: Check out gh-pages branch
@@ -318,17 +319,9 @@ jobs:
318319
if [[ "${REF_TYPE}" == branch ]]; then
319320
TARGET_FOLDER="${REF_NAME}"
320321
elif [[ "${REF_TYPE}" == tag ]]; then
321-
case "${REF_NAME}" in
322-
*-rc*)
323-
echo "Aborting upload since this is an RC tag: ${REF_NAME}"
324-
exit 0
325-
;;
326-
*)
327-
# Strip the leading "v" as well as the trailing patch version. For example:
328-
# 'v0.10.2' -> '0.10'
329-
TARGET_FOLDER=$(echo "${REF_NAME}" | sed 's/v\([0-9]\+\)\.\([0-9]\+\)\.[0-9]\+/\1.\2/')
330-
;;
331-
esac
322+
# Strip the leading "v" as well as the trailing patch version. For example:
323+
# 'v0.10.2' -> '0.10'
324+
TARGET_FOLDER=$(echo "${REF_NAME}" | sed 's/v\([0-9]\+\)\.\([0-9]\+\)\.[0-9]\+/\1.\2/')
332325
fi
333326
echo "Target Folder: ${TARGET_FOLDER}"
334327

0 commit comments

Comments
 (0)