From b90916b5f79d4f1180b7dd8b54968485ee8da7c2 Mon Sep 17 00:00:00 2001 From: Matteo Pologruto Date: Thu, 17 Nov 2022 16:26:15 +0100 Subject: [PATCH 1/3] Avoid running publish-go-tester-task if tag is set --- .github/workflows/publish-go-tester-task.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 7635da8ba55..580423f8a26 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -35,14 +35,21 @@ jobs: outputs: result: ${{ steps.determination.outputs.result }} steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Determine if the rest of the workflow should run id: determination run: | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + TAG="$(git tag --points-at=HEAD 2> /dev/null | head -n1)" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ \ - "${{ github.event_name }}" != "create" || \ - "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX \ + ("${{ github.event_name }}" != "create" || \ + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) && \ + "$TAG" == "" \ ]]; then # Run the other jobs. RESULT="true" From 3fdbc7c2d9aa59e4d29753facef0aa858c97226b Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Fri, 2 Dec 2022 10:38:27 +0100 Subject: [PATCH 2/3] Update .github/workflows/publish-go-tester-task.yml Co-authored-by: per1234 --- .github/workflows/publish-go-tester-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 580423f8a26..745bcaa4cd6 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -49,7 +49,7 @@ jobs: if [[ \ ("${{ github.event_name }}" != "create" || \ "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) && \ - "$TAG" == "" \ + ! "${{ github.ref }}" =~ $TAG_REGEX \ ]]; then # Run the other jobs. RESULT="true" From 83c8b5203770da8197420064c2432730eee2cb9b Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Fri, 2 Dec 2022 10:38:36 +0100 Subject: [PATCH 3/3] Update .github/workflows/publish-go-tester-task.yml Co-authored-by: per1234 --- .github/workflows/publish-go-tester-task.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 745bcaa4cd6..73a6c57491a 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -35,16 +35,11 @@ jobs: outputs: result: ${{ steps.determination.outputs.result }} steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Determine if the rest of the workflow should run id: determination run: | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" - TAG="$(git tag --points-at=HEAD 2> /dev/null | head -n1)" + TAG_REGEX="refs/tags/.*" # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. if [[ \ ("${{ github.event_name }}" != "create" || \