From 9a1e420fa781ca059337b8b665e38ff53027e4e8 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Sun, 20 Apr 2025 14:19:31 +0200 Subject: [PATCH] ci: bugfix cancelling only when push to master or workflow dispatch. Otherwise don't let it cancel as it seems that when running with pull_request_target we are with ref pointing to target and thus the cancel condition was being met --- .github/workflows/sunnypilot-master-dev-c3-prep.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sunnypilot-master-dev-c3-prep.yaml b/.github/workflows/sunnypilot-master-dev-c3-prep.yaml index 1385a32aa..031be6a50 100644 --- a/.github/workflows/sunnypilot-master-dev-c3-prep.yaml +++ b/.github/workflows/sunnypilot-master-dev-c3-prep.yaml @@ -13,7 +13,7 @@ on: - master - master-new pull_request_target: - types: [ synchronize, labeled ] + types: [ labeled ] branches: - 'master' - 'master-new' @@ -29,12 +29,15 @@ on: required: true default: 'master-dev-c3-new' type: string + cancel_in_progress: + description: 'Cancel any in-progress runs of this workflow' + required: false + default: true + type: boolean concurrency: group: ${{ github.workflow }} - cancel-in-progress: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} - -run-name: ${{ contains(github.event_name, 'pull_request') && github.event.action == 'synchronize' && format('{0} - {1}', github.workflow, github.event.action) || format('{0} - {1}', github.workflow, github.event_name) }} + cancel-in-progress: ${{ inputs.cancel_in_progress || github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} jobs: reset-and-squash: