From 52b1216e344d3f50ccec7bff87a8f00b1ab32582 Mon Sep 17 00:00:00 2001 From: Ankitsinghsisodya Date: Sat, 28 Mar 2026 01:08:50 +0530 Subject: [PATCH 1/2] ci: add concurrency group to functions.yaml to cancel redundant runs Without a concurrency configuration, pushing multiple commits to the same PR triggers multiple simultaneous workflow runs. Add a concurrency group keyed on workflow name and ref so that only the latest run for a given branch or PR is active, cancelling any in-progress predecessor. Fixes knative/func#3531 --- .github/workflows/functions.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/functions.yaml b/.github/workflows/functions.yaml index 7a5b0f5857..dd79bf6cc1 100644 --- a/.github/workflows/functions.yaml +++ b/.github/workflows/functions.yaml @@ -16,6 +16,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # Global version definitions env: PYTHON_VERSION: "3.10" From f9ebdf59f46aa1673074744e1d9034c856acdc80 Mon Sep 17 00:00:00 2001 From: Ankitsinghsisodya Date: Sat, 28 Mar 2026 01:29:00 +0530 Subject: [PATCH 2/2] ci: only cancel in-progress runs for PRs, not main pushes Pushes to main trigger build and publish jobs. Cancelling an in-progress main run when another push arrives could interrupt image publishing. Make cancel-in-progress conditional on pull_request events only. --- .github/workflows/functions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functions.yaml b/.github/workflows/functions.yaml index dd79bf6cc1..0755713fd1 100644 --- a/.github/workflows/functions.yaml +++ b/.github/workflows/functions.yaml @@ -18,7 +18,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} # Global version definitions env: