From b90e9a1b3dd6fcc7dc05ee35e95627fb0c688190 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy Date: Fri, 3 Feb 2023 21:48:17 +0000 Subject: [PATCH] Update branch name extraction for tag builds (#972) * Update branch name logic for tag builds to handle leading whitespace * Add fetch for release branches --- .github/workflows/datasets.yml | 4 ++-- .github/workflows/implicit.yml | 4 ++-- .github/workflows/lightfm.yml | 4 ++-- .github/workflows/pytorch.yml | 5 +++-- .github/workflows/tensorflow.yml | 8 ++++---- .github/workflows/xgboost.yml | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/datasets.yml b/.github/workflows/datasets.yml index ae2c240fa7..7c0ac3c01c 100644 --- a/.github/workflows/datasets.yml +++ b/.github/workflows/datasets.yml @@ -32,8 +32,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch" diff --git a/.github/workflows/implicit.yml b/.github/workflows/implicit.yml index 42f751fcd9..3feac70d33 100644 --- a/.github/workflows/implicit.yml +++ b/.github/workflows/implicit.yml @@ -32,8 +32,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch" diff --git a/.github/workflows/lightfm.yml b/.github/workflows/lightfm.yml index 715e64aaaa..05328c18d2 100644 --- a/.github/workflows/lightfm.yml +++ b/.github/workflows/lightfm.yml @@ -32,8 +32,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch" diff --git a/.github/workflows/pytorch.yml b/.github/workflows/pytorch.yml index 0b341f2e9b..647680da0a 100644 --- a/.github/workflows/pytorch.yml +++ b/.github/workflows/pytorch.yml @@ -1,3 +1,4 @@ + name: pytorch on: @@ -32,8 +33,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch" diff --git a/.github/workflows/tensorflow.yml b/.github/workflows/tensorflow.yml index 40fa7f5b29..7ef0d3a055 100644 --- a/.github/workflows/tensorflow.yml +++ b/.github/workflows/tensorflow.yml @@ -38,8 +38,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch" @@ -93,8 +93,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch" diff --git a/.github/workflows/xgboost.yml b/.github/workflows/xgboost.yml index 8a0b2b2003..fc92c618b3 100644 --- a/.github/workflows/xgboost.yml +++ b/.github/workflows/xgboost.yml @@ -32,8 +32,8 @@ jobs: branch=main if [[ $ref_type == "tag"* ]] then - raw=$(git branch -r --contains ${{ github.ref_name }}) - branch=${raw/origin\/} + git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/release*:refs/remotes/origin/release* + branch=$(git branch -r --contains ${{ github.ref_name }} --list '*release*' --format "%(refname:short)" | sed -e 's/^origin\///') fi pip install "pandas>=1.2.0,<1.4.0dev0" pip install "NVTabular@git+https://github.com/NVIDIA-Merlin/NVTabular.git@$branch"