From 5ccfc4e83d68702c0c1fa6e3f63589924934ac5f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 21 Aug 2023 10:59:04 -0700 Subject: [PATCH] Stop the "publish" action from running on snapshot builds --- .github/workflows/publish.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3640b0d4..1b5c0e637 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,6 +20,18 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + + - name: Set package version + shell: bash + run: echo "PACKAGE_VERSION=`npm pkg get version|tr -d '\"'`" >> $GITHUB_ENV + + - name: Cancel job if the package version matches "-snapshot$" + uses: andymckay/cancel-action@0.3 + # We only want to build master if we have a snapshot version + # ..otherwise, building main will clobber releases...sometimes + # due to a race condition. + if: ${{ endsWith( env.PACKAGE_VERSION, '-snapshot') }} + - name: Install the Apple certificate and provisioning profile if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/') env: