From e734ee11fbd545becb4fc7f9db36db2341e507e5 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 18 Jul 2023 23:17:20 -0700 Subject: [PATCH] Avoid running "Publish Tester Build" workflow on tag push In order to provide coverage for projects using release branches, the "Publish Tester Build" workflow has a `create` event trigger. This trigger is intended to cause the workflow to run on the creation of a release branch. The same `create` event also occurs when a tag is pushed to the repository. There is no need to generate a tester build for tags because these are only made after the project is in a fully tested state and the tag push will trigger a release build that makes a generated tester build superfluous anyway. For this reason, and because the triggering of the tester build on this event can cause problems in some project, the workflow is configured to skip the generation of the tester build when it was triggered by a tag push. --- .github/workflows/publish-go-tester-task.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 10a558dc..8e8b3c08 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -36,10 +36,12 @@ jobs: id: determination run: | RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + 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" || - "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX) && + ! "${{ github.ref }}" =~ $TAG_REGEX ]]; then # Run the other jobs. RESULT="true"