From c927011e03de8052097cacafc1795e9c3f007358 Mon Sep 17 00:00:00 2001 From: itsankit-google Date: Mon, 9 Sep 2024 06:43:35 +0000 Subject: [PATCH] Add support to skip action if release exists --- .github/workflows/build-and-unit-test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-unit-test.yml b/.github/workflows/build-and-unit-test.yml index 7dbb629f..dca866cf 100644 --- a/.github/workflows/build-and-unit-test.yml +++ b/.github/workflows/build-and-unit-test.yml @@ -41,6 +41,7 @@ env: PRE_RELEASE: true REPLACE_ARTIFACTS: true REMOVE_ARTIFACTS: true + SKIP_RELEASE: false MAX_ATTEMPTS: 3 jobs: @@ -173,6 +174,7 @@ jobs: echo "PRE_RELEASE=false" >> $GITHUB_ENV echo "REPLACE_ARTIFACTS=false" >> $GITHUB_ENV echo "REMOVE_ARTIFACTS=false" >> $GITHUB_ENV + echo "SKIP_RELEASE=true" >> $GITHUB_ENV echo "Release will not be overwritten if exists." else echo "Release will be overwritten if exists." @@ -269,13 +271,14 @@ jobs: fi - name: Upload CDAP Standalone and CDAP DEB Bundle - # Pinned 1.11.1 version - uses: ncipollo/release-action@4c75f0f2e4ae5f3c807cf0904605408e319dcaac + # Pinned 1.14.0 version + uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 with: allowUpdates: true omitBodyDuringUpdate: true omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true + skipIfReleaseExists: ${{ env.SKIP_RELEASE }} prerelease: ${{ env.PRE_RELEASE }} removeArtifacts: ${{ env.REMOVE_ARTIFACTS }} replacesArtifacts: ${{ env.REPLACE_ARTIFACTS }}