From db4bd32767bca34085c751a31154abeae989c046 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Tue, 24 Jan 2023 13:08:04 +0100 Subject: [PATCH] cancel running tests if new commit to branch is made Signed-off-by: Sebastian Gumprich --- .github/workflows/mysql_hardening.yml | 8 ++++++++ .github/workflows/nginx_hardening.yml | 8 ++++++++ .github/workflows/os_hardening.yml | 8 ++++++++ .github/workflows/os_hardening_vm.yml | 8 ++++++++ .github/workflows/ssh_hardening.yml | 8 ++++++++ .github/workflows/ssh_hardening_custom_tests.yml | 8 ++++++++ 6 files changed, 48 insertions(+) diff --git a/.github/workflows/mysql_hardening.yml b/.github/workflows/mysql_hardening.yml index 85bddcc9..e47367c7 100644 --- a/.github/workflows/mysql_hardening.yml +++ b/.github/workflows/mysql_hardening.yml @@ -15,6 +15,14 @@ on: # yamllint disable-line rule:truthy - 'roles/mysql_hardening/**' - 'molecule/mysql_hardening/**' - '.github/workflows/mysql_hardening.yml' + +concurrency: + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || github.sha + }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-18.04 diff --git a/.github/workflows/nginx_hardening.yml b/.github/workflows/nginx_hardening.yml index a17cf1cd..bb444a23 100644 --- a/.github/workflows/nginx_hardening.yml +++ b/.github/workflows/nginx_hardening.yml @@ -14,6 +14,14 @@ on: # yamllint disable-line rule:truthy - 'roles/nginx_hardening/**' - 'molecule/nginx_hardening/**' - '.github/workflows/nginx_hardening.yml' + +concurrency: + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || github.sha + }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-18.04 diff --git a/.github/workflows/os_hardening.yml b/.github/workflows/os_hardening.yml index cf8aa6ef..d6c01ed9 100644 --- a/.github/workflows/os_hardening.yml +++ b/.github/workflows/os_hardening.yml @@ -14,6 +14,14 @@ on: # yamllint disable-line rule:truthy - 'roles/os_hardening/**' - 'molecule/os_hardening/**' - '.github/workflows/os_hardening.yml' + +concurrency: + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || github.sha + }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-18.04 diff --git a/.github/workflows/os_hardening_vm.yml b/.github/workflows/os_hardening_vm.yml index d3c7647f..bd3d75b7 100644 --- a/.github/workflows/os_hardening_vm.yml +++ b/.github/workflows/os_hardening_vm.yml @@ -14,6 +14,14 @@ on: # yamllint disable-line rule:truthy - 'roles/os_hardening/**' - 'molecule/os_hardening_vm/**' - '.github/workflows/os_hardening_vm.yml' + +concurrency: + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || github.sha + }} + cancel-in-progress: true + jobs: build: runs-on: self-hosted diff --git a/.github/workflows/ssh_hardening.yml b/.github/workflows/ssh_hardening.yml index 9f618fa7..bfc30dac 100644 --- a/.github/workflows/ssh_hardening.yml +++ b/.github/workflows/ssh_hardening.yml @@ -14,6 +14,14 @@ on: # yamllint disable-line rule:truthy - 'roles/ssh_hardening/**' - 'molecule/ssh_hardening/**' - '.github/workflows/ssh_hardening.yml' + +concurrency: + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || github.sha + }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-18.04 diff --git a/.github/workflows/ssh_hardening_custom_tests.yml b/.github/workflows/ssh_hardening_custom_tests.yml index 3b1a4ebc..2d6c2dac 100644 --- a/.github/workflows/ssh_hardening_custom_tests.yml +++ b/.github/workflows/ssh_hardening_custom_tests.yml @@ -14,6 +14,14 @@ on: # yamllint disable-line rule:truthy - 'roles/ssh_hardening/**' - 'molecule/ssh_hardening_custom_tests/**' - '.github/workflows/ssh_hardening_custom_tests.yml' + +concurrency: + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || github.sha + }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-18.04