chore: limit concurrency for build jobs (#4929)
* Configure build jobs to cancel previous builds when new changes are pushed to a pull request branch, and serialize builds when running in a branch from a push event * Reduce privileges of GitHub token for scripts workflow
This commit is contained in:
parent
2c785779b5
commit
83269ba658
7
.github/workflows/ci.yaml
vendored
7
.github/workflows/ci.yaml
vendored
@ -8,6 +8,13 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
# Note: if: success() is used in several jobs -
|
# Note: if: success() is used in several jobs -
|
||||||
# this ensures that it only executes if all previous jobs succeeded.
|
# this ensures that it only executes if all previous jobs succeeded.
|
||||||
|
|
||||||
|
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@ -10,6 +10,13 @@ on:
|
|||||||
# Runs every Monday morning PST
|
# Runs every Monday morning PST
|
||||||
- cron: "17 15 * * 1"
|
- cron: "17 15 * * 1"
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
|
7
.github/workflows/docker.yaml
vendored
7
.github/workflows/docker.yaml
vendored
@ -9,6 +9,13 @@ on:
|
|||||||
types:
|
types:
|
||||||
- released
|
- released
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-images:
|
docker-images:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
7
.github/workflows/docs-preview.yaml
vendored
7
.github/workflows/docs-preview.yaml
vendored
@ -17,6 +17,13 @@ permissions:
|
|||||||
security-events: none
|
security-events: none
|
||||||
statuses: none
|
statuses: none
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
preview:
|
preview:
|
||||||
name: Docs preview
|
name: Docs preview
|
||||||
|
7
.github/workflows/installer.yml
vendored
7
.github/workflows/installer.yml
vendored
@ -12,6 +12,13 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "install.sh"
|
- "install.sh"
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu:
|
ubuntu:
|
||||||
name: Test installer on Ubuntu
|
name: Test installer on Ubuntu
|
||||||
|
7
.github/workflows/npm-brew.yaml
vendored
7
.github/workflows/npm-brew.yaml
vendored
@ -8,6 +8,13 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [released]
|
types: [released]
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# NOTE: this job requires curl, jq and yarn
|
# NOTE: this job requires curl, jq and yarn
|
||||||
# All of them are included in ubuntu-latest.
|
# All of them are included in ubuntu-latest.
|
||||||
|
19
.github/workflows/scripts.yml
vendored
19
.github/workflows/scripts.yml
vendored
@ -14,6 +14,25 @@ on:
|
|||||||
- "**.sh"
|
- "**.sh"
|
||||||
- "**.bats"
|
- "**.bats"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: none
|
||||||
|
checks: none
|
||||||
|
contents: read
|
||||||
|
deployments: none
|
||||||
|
issues: none
|
||||||
|
packages: none
|
||||||
|
pull-requests: none
|
||||||
|
repository-projects: none
|
||||||
|
security-events: none
|
||||||
|
statuses: none
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Run script unit tests
|
name: Run script unit tests
|
||||||
|
Reference in New Issue
Block a user