Skip to content

Commit

Permalink
Improve concurrency of GitHub Actions (#1128)
Browse files Browse the repository at this point in the history
* improve concurrency of GitHub Actions

This will allow you to cancel older running actions for the current PR /
branch. This saves you some resources, but more importantly hopefully
frees up some spots in the queue a bit faster.

Saw this on the Node.js repo: nodejs/node#42017

* empty commit to trigger cancellation of previous commit
  • Loading branch information
RobinMalfait authored Feb 21, 2022
1 parent 5deddef commit 0c213b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: CI

on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
NODE_VERSION: 12.x

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 0c213b5

Please sign in to comment.