Skip to content

Commit c9fb940

Browse files
committed
manage concurrency in push and push_pr workflows
1 parent 03643c6 commit c9fb940

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/push.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ on:
33
branches:
44
- main
55

6-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
6+
# Cancel previous runs if a new commit is pushed to the same PR or branch
7+
concurrency:
8+
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
9+
cancel-in-progress: true # Cancel any ongoing runs in the same group
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages and modify PR labels
712
permissions:
8-
contents: read
9-
pages: write
10-
id-token: write
13+
contents: read # Read access to repository contents
14+
pages: write # Write access to GitHub Pages
15+
id-token: write # Write access to ID tokens
1116

1217
jobs:
1318
style_lint:

.github/workflows/push_pr.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
on:
22
pull_request:
33

4+
# Cancel previous runs if a new commit is pushed to the same PR or branch
5+
concurrency:
6+
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
7+
cancel-in-progress: true # Cancel any ongoing runs in the same group
8+
49
jobs:
510
build_project:
611
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)