From 3ea6429895423c50a6fbbdfc10f15ebda24892c2 Mon Sep 17 00:00:00 2001 From: Kitsios Konstantinos Date: Wed, 2 Jul 2025 12:55:30 +0300 Subject: [PATCH] chore: Cancel redundant ci runs on consecutive pushes on the same PR (#11851) Currently, if a PR is open and a push happens, the Run Size Limit Check workflow will start running. If, shortly after a subsequent push on the same PR happens, the workflow will start running again without cancelling the previous (now obsolete) run. With these changes, the first run would be cancelled, thus saving compute resources (see below for quantity) without sacrificing functionality, since the second run will contain the changes from the first push as well. --- .github/workflows/deploy_check.yml | 5 +++++ .github/workflows/logging_percentage_check.yml | 5 +++++ .github/workflows/size-limit.yml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/.github/workflows/deploy_check.yml b/.github/workflows/deploy_check.yml index 7fda2b1a4..9f295a6c8 100644 --- a/.github/workflows/deploy_check.yml +++ b/.github/workflows/deploy_check.yml @@ -6,6 +6,11 @@ name: Deploy Check on: pull_request: +# If two pushes happen within a short time in the same PR, cancel the run of the oldest push +concurrency: + group: pr-${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + jobs: deployment_check: name: Check Deployment diff --git a/.github/workflows/logging_percentage_check.yml b/.github/workflows/logging_percentage_check.yml index e9f84c313..5c45ba635 100644 --- a/.github/workflows/logging_percentage_check.yml +++ b/.github/workflows/logging_percentage_check.yml @@ -5,6 +5,11 @@ on: branches: - develop +# If two pushes happen within a short time in the same PR, cancel the run of the oldest push +concurrency: + group: pr-${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + jobs: log_lines_check: runs-on: ubuntu-latest diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 9be79da05..c2a4bd174 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -5,6 +5,11 @@ on: branches: - develop +# If two pushes happen within a short time in the same PR, cancel the run of the oldest push +concurrency: + group: pr-${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-22.04