From 1bff6fbe33a03342fb8e7f9034df8d0f53083b1c Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Thu, 9 Jun 2022 07:37:32 -0700 Subject: [PATCH] Fix `if` condition for s3/conda uploads Replace `steps.extract_branch.outputs.branch` (which were probably taken from https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions ) with straightforward `github.event.ref` Tested in https://github.com/malfet/deleteme/runs/6822647720?check_suite_focus=true and https://github.com/malfet/deleteme/runs/6822691158?check_suite_focus=true --- .github/workflows/build-m1-binaries.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-m1-binaries.yml b/.github/workflows/build-m1-binaries.yml index eec54b2f113..fe695e4bf6e 100644 --- a/.github/workflows/build-m1-binaries.yml +++ b/.github/workflows/build-m1-binaries.yml @@ -79,7 +79,7 @@ jobs: name: torchvision-py${{ matrix.py_vers }}-macos11-m1 path: dist/ - name: Upload wheel to S3 - if: ${{ github.event_name == 'push' && (steps.extract_branch.outputs.branch == 'nightly' || startsWith(github.event.ref, 'refs/tags/')) }} + if: ${{ github.event_name == 'push' && (github.event.ref == 'ref/heads/nightly' || startsWith(github.event.ref, 'refs/tags/')) }} shell: arch -arch arm64 bash {0} env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID }} @@ -139,7 +139,7 @@ jobs: name: torchvision-py${{ matrix.py_vers }}-macos11-m1-conda path: dist/ - name: Upload package to conda - if: ${{ github.event_name == 'push' && steps.extract_branch.outputs.branch == 'nightly' }} + if: ${{ github.event_name == 'push' && (github.event.ref == 'ref/heads/nightly' || startsWith(github.event.ref, 'refs/tags/')) }} shell: arch -arch arm64 bash {0} env: CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}