-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test github.token * Use default token * Update README
- Loading branch information
Showing
3 changed files
with
6 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up mutex | ||
uses: ben-z/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
uses: ben-z/[email protected] | ||
- run: | | ||
echo "I am protected!" | ||
sleep 5 | ||
|
@@ -35,15 +33,16 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up mutex | ||
uses: ben-z/[email protected]3 | ||
uses: ben-z/[email protected]4 | ||
with: | ||
branch: another-mutex | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
echo "I am protected by the 'another-mutex' mutex!" | ||
sleep 5 | ||
``` | ||
|
||
More options such as using a different repo to store the mutex (which allows sharing a mutex between jobs from arbitrary repos) or using different access tokens can be found in [actions.yml](./actions.yml) | ||
|
||
## Motivation | ||
|
||
GitHub Action has the [concurrency](https://docs.github.com/en/actions/using-jobs/using-concurrency) option for preventing running multiple jobs concurrently. However, it has a queue of length 1. When there are multiple jobs with the same concurrency group gets queued, only the currently running job and the latest job are kept. Other jobs are simply cancelled. There's more discussion [here](https://github.com/github/feedback/discussions/5435) and it appears that GitHub does not want to add the requested `cancel-pending` feature any time soon (as of 2022-03-26). This GitHub action solves that issue. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters