From c26f6545c969c6f4946db555deecca4412bdc24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Mon, 30 Oct 2023 18:37:13 +0100 Subject: [PATCH] Replace styfle/cancel-workflow-action with new GitHub `concurrency:` standard (#2316) see https://github.com/styfle/cancel-workflow-action/blob/main/README.md --- .github/workflows/build.yml | 11 +++++++---- .github/workflows/codeql.yaml | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22419da6dc..cef0fbf978 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,13 @@ env: GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "fhir" # change this to invalidate cache +concurrency: + # github.head_ref uniquely identifies Pull Requests (but is not available when building branches like main or master) + # github.ref is the fallback used when building for workflows triggered by push + # Note that || are fallback values (not "concatenations") + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true # Use e.g. ${{ github.ref != 'refs/heads/main' }} (or master, until #2180) to only cancel for PRs not on branch + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # Build will compile APK, test APK and run tests, lint, etc. @@ -49,10 +56,6 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Cancel previous - uses: styfle/cancel-workflow-action@0.12.0 - with: - access_token: ${{ github.token }} # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Checkout Repo diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 0df5358f2c..1f90d2cb89 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -28,6 +28,10 @@ on: schedule: - cron: '32 13 * * 2' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref || || github.run_id }} + cancel-in-progress: true + jobs: analyze: name: Analyze