From c9effeebc193ad265b5832fa58204be074c5a552 Mon Sep 17 00:00:00 2001 From: takeshix Date: Mon, 19 Apr 2021 16:38:56 +0200 Subject: [PATCH] Updated tag checks --- .github/workflows/build-gdb.yml | 9 +++++---- .github/workflows/build-nmap.yml | 9 +++++---- .github/workflows/build-socat.yml | 9 +++++---- .github/workflows/build-tcpdump.yml | 9 +++++---- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 15208e8..710af0d 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -146,12 +146,13 @@ jobs: id: tag_release run: | set +e - if [ $(git tag "gdb-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "gdb-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for gdb-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "gdb-v${{ needs.build-x86.outputs.version }}" git push origin "gdb-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 diff --git a/.github/workflows/build-nmap.yml b/.github/workflows/build-nmap.yml index 0c38912..93e1188 100644 --- a/.github/workflows/build-nmap.yml +++ b/.github/workflows/build-nmap.yml @@ -147,12 +147,13 @@ jobs: - name: Tag Release run: | set +e - if [ $(git tag "nmap-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "nmap-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for nmap-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "nmap-v${{ needs.build-x86.outputs.version }}" git push origin "nmap-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 diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index 545eb3d..3c8a4fd 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -139,12 +139,13 @@ jobs: id: tag_release run: | set +e - if [ $(git tag "socat-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "socat-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for socat-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "socat-v${{ needs.build-x86.outputs.version }}" git push origin "socat-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 diff --git a/.github/workflows/build-tcpdump.yml b/.github/workflows/build-tcpdump.yml index 5c6614e..12f3a05 100644 --- a/.github/workflows/build-tcpdump.yml +++ b/.github/workflows/build-tcpdump.yml @@ -110,12 +110,13 @@ jobs: - name: Tag Release run: | set +e - if [ $(git tag "tcpdump-v${{ needs.build-x86.outputs.version }}") ];then + if git rev-list "tcpdump-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then + echo "Tag for tcpdump-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation." + echo ::set-output name=NEW_RELEASE::"false" + else + git tag "tcpdump-v${{ needs.build-x86.outputs.version }}" 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