diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a7c71d0..4774132 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,9 +11,12 @@ env: permissions: contents: read +# A newer push to the same pull request or branch cancels the older run. +# Each run on main gets its own group, so runs on main are never +# cancelled or dropped while waiting. concurrency: - group: docs-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: build: diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 6a7f6e5..2d0b89d 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -5,13 +5,14 @@ on: push: branches: [main] pull_request: + workflow_dispatch: -# A newer update to the same pull request stops the older run. -# Every other run, such as a push to main, gets its own group so it is -# never stopped. +# A newer push to the same pull request or branch cancels the older run. +# Each run on main gets its own group, so runs on main are never +# cancelled or dropped while waiting. concurrency: - group: ci-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} permissions: contents: read