From b613a7377c1cfede10c73eed19c1f17514f3e399 Mon Sep 17 00:00:00 2001 From: takeshix Date: Mon, 19 Apr 2021 15:15:15 +0200 Subject: [PATCH] Added tag check to tcpdump workflow --- .github/workflows/build-tcpdump.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index b1eff60..5c6614e 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -109,11 +109,18 @@ jobs: - name: Tag Release run: | - git tag "tcpdump-v${{ needs.build-x86.outputs.version }}" - git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" + set +e + if [ $(git tag "tcpdump-v${{ needs.build-x86.outputs.version }}") ];then + git push origin "tcpdump-v${{ needs.build-x86.outputs.version }}" + echo ::set-output name=NEW_RELEASE::"true" + else + echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + fi - name: Create Release uses: ncipollo/release-action@v1 + if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }} with: name: tcpdump-v${{ needs.build-x86.outputs.version }} tag: tcpdump-v${{ needs.build-x86.outputs.version }}