diff --git a/.github/workflows/test-python-poetry-task.yml b/.github/workflows/test-python-poetry-task.yml index ac402a00..ede1fdfb 100644 --- a/.github/workflows/test-python-poetry-task.yml +++ b/.github/workflows/test-python-poetry-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-python-poetry-task.ya?ml" @@ -27,7 +28,32 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: diff --git a/workflow-templates/check-go-task.yml b/workflow-templates/check-go-task.yml index 2eb4f8a8..d0ebe1b6 100644 --- a/workflow-templates/check-go-task.yml +++ b/workflow-templates/check-go-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/check-go-task.ya?ml" @@ -25,8 +26,33 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + check-errors: name: check-errors (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -59,6 +85,8 @@ jobs: check-outdated: name: check-outdated (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -94,6 +122,8 @@ jobs: check-style: name: check-style (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -129,6 +159,8 @@ jobs: check-formatting: name: check-formatting (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -164,6 +196,8 @@ jobs: check-config: name: check-config (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: diff --git a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/check-go-task.yml b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/check-go-task.yml index 2eb4f8a8..d0ebe1b6 100644 --- a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/check-go-task.yml +++ b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/check-go-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/check-go-task.ya?ml" @@ -25,8 +26,33 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + check-errors: name: check-errors (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -59,6 +85,8 @@ jobs: check-outdated: name: check-outdated (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -94,6 +122,8 @@ jobs: check-style: name: check-style (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -129,6 +159,8 @@ jobs: check-formatting: name: check-formatting (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: @@ -164,6 +196,8 @@ jobs: check-config: name: check-config (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest strategy: diff --git a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/publish-go-tester-task.yml b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/publish-go-tester-task.yml index b26ec07f..94cd19ae 100644 --- a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/publish-go-tester-task.yml +++ b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/publish-go-tester-task.yml @@ -3,6 +3,7 @@ name: Publish Tester Build # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/publish-go-tester-task.ya?ml" @@ -28,7 +29,32 @@ env: BUILDS_ARTIFACT: build-artifacts jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + build: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: diff --git a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-integration-task.yml b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-integration-task.yml index 91e04288..1d2c2d62 100644 --- a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-integration-task.yml +++ b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-integration-task.yml @@ -9,6 +9,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-go-integration-task.ya?ml" @@ -33,7 +34,33 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + strategy: matrix: operating-system: diff --git a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-task.yml b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-task.yml index 7a2e5d80..f900cb52 100644 --- a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-task.yml +++ b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-go-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-go-task.ya?ml" @@ -29,8 +30,33 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' strategy: fail-fast: false diff --git a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-python-poetry-task.yml b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-python-poetry-task.yml index ac402a00..ede1fdfb 100644 --- a/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-python-poetry-task.yml +++ b/workflow-templates/dependabot/workflow-template-copies/.github/workflows/test-python-poetry-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-python-poetry-task.ya?ml" @@ -27,7 +28,32 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: diff --git a/workflow-templates/publish-go-tester-task.yml b/workflow-templates/publish-go-tester-task.yml index b26ec07f..94cd19ae 100644 --- a/workflow-templates/publish-go-tester-task.yml +++ b/workflow-templates/publish-go-tester-task.yml @@ -3,6 +3,7 @@ name: Publish Tester Build # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/publish-go-tester-task.ya?ml" @@ -28,7 +29,32 @@ env: BUILDS_ARTIFACT: build-artifacts jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + build: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: diff --git a/workflow-templates/test-go-integration-task.yml b/workflow-templates/test-go-integration-task.yml index 91e04288..1d2c2d62 100644 --- a/workflow-templates/test-go-integration-task.yml +++ b/workflow-templates/test-go-integration-task.yml @@ -9,6 +9,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-go-integration-task.ya?ml" @@ -33,7 +34,33 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + strategy: matrix: operating-system: diff --git a/workflow-templates/test-go-task.yml b/workflow-templates/test-go-task.yml index 7a2e5d80..f900cb52 100644 --- a/workflow-templates/test-go-task.yml +++ b/workflow-templates/test-go-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-go-task.ya?ml" @@ -29,8 +30,33 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' strategy: fail-fast: false diff --git a/workflow-templates/test-python-poetry-task.yml b/workflow-templates/test-python-poetry-task.yml index ac402a00..ede1fdfb 100644 --- a/workflow-templates/test-python-poetry-task.yml +++ b/workflow-templates/test-python-poetry-task.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/test-python-poetry-task.ya?ml" @@ -27,7 +28,32 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # 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 \ + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + test: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest steps: