Skip to content

Commit

Permalink
manage concurrency in push and push_pr workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pitmonticone committed Oct 16, 2024
1 parent 03643c6 commit c9fb940
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ on:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Cancel previous runs if a new commit is pushed to the same PR or branch
concurrency:
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
cancel-in-progress: true # Cancel any ongoing runs in the same group

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages and modify PR labels
permissions:
contents: read
pages: write
id-token: write
contents: read # Read access to repository contents
pages: write # Write access to GitHub Pages
id-token: write # Write access to ID tokens

jobs:
style_lint:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
on:
pull_request:

# Cancel previous runs if a new commit is pushed to the same PR or branch
concurrency:
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
cancel-in-progress: true # Cancel any ongoing runs in the same group

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

0 comments on commit c9fb940

Please sign in to comment.