Skip to content

Commit

Permalink
docs(github action): suggest using concurrency (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoIeni authored Oct 5, 2024
1 parent 69ad93e commit 2e597d7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-24.04
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
# Generating a GitHub token, so that PRs and tags created by
# the release-plz-action can trigger actions workflows.
Expand Down
6 changes: 6 additions & 0 deletions crates/release_plz/src/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{{{ github.ref }}}}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -179,6 +182,9 @@ mod tests {
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
9 changes: 9 additions & 0 deletions website/docs/github/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -54,6 +57,9 @@ If you want to run other checks before releasing (e.g. `cargo test`), you have t
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -83,6 +89,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
9 changes: 9 additions & 0 deletions website/docs/github/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ After the action runs, it outputs the following properties:
jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -111,6 +114,9 @@ configuration field.
jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -169,6 +175,9 @@ You can commit files to the release PR opened by release-plz.
jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
21 changes: 21 additions & 0 deletions website/docs/github/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -93,6 +96,12 @@ Notes:
- `fetch-depth: 0` is needed to clone all the git history, which is necessary to
determine the next version and build the changelog.
- The `concurrency` block guarantees that if a new commit is pushed while the job of the previous
commit was still running, the new job will wait for the previous one to finish.
In this way, only one instance of release-plz will run in the repository at the same time for
the same branch, ensuring that there are no conflicts.
See the GitHub [docs](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idconcurrency)
to learn more.

### Example: release-pr only

Expand All @@ -115,6 +124,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -151,6 +163,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -191,6 +206,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -234,6 +252,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions website/docs/github/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down

0 comments on commit 2e597d7

Please sign in to comment.