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