diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 83aafc639..458f1fd8f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,9 +1,17 @@ name: Build docs +# See main.yml on: - push: - branches: ["master", "docs"] workflow_dispatch: + push: + branches: [ master ] + pull_request: + types: [opened, synchronize] + merge_group: +# Cancel builds if a new commit is pushed, except on master +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} # Gives the workflow permissions to clone the repo and create a page deployment permissions: @@ -66,6 +74,7 @@ jobs: # Requires the build results needs: build runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' steps: - name: Download artifact uses: actions/download-artifact@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed26638c4..cf7428a79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,10 @@ on: pull_request: types: [opened, synchronize] merge_group: +# Cancel builds if a new commit is pushed, except on master +concurrency: + group: ${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: qodana: