@ebalzan/ci 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -77,7 +77,7 @@ git push -u origin feat/search-filters
77
77
  - the milestone and the project board, when the repo configures them;
78
78
  - an AI-written description.
79
79
 
80
- It opens the PR as a draft and marks it ready for review once all of that is done.
80
+ PR Checks runs once per push and waits for Auto PR to finish, so it checks the finished PR.
81
81
 
82
82
  While you work, keep the branch on top of `dev` by **rebasing, never merging**. The branch is yours, so rewriting it is fine:
83
83
 
@@ -117,7 +117,7 @@ Its check (`pr-check / Release PR`) holds it to the computed title. It also requ
117
117
 
118
118
  When the release PR's check passes, **add the `ship` label**. The **Release** workflow then does this:
119
119
 
120
- 1. **Verify.** `dev` is still the PR's head, `main` fast-forwards to it, there's no merge commit, and the PR check passed. If the check is still running, it waits.
120
+ 1. **Verify.** `dev` is still the PR's head, `main` fast-forwards to it, there's no merge commit, and the PR check passed. If the check is still running, it waits. Adding the label doesn't run the check again: PR Checks skips that one event, and Release reads the result the commit already has. Removing the label still runs it.
121
121
  2. **Version and tag.** It recomputes the title and requires it to equal the PR's. In a Node repo it commits `chore(release): X.Y.Z` to bump `package.json`. Then it pushes **`main` and `dev` to that same commit**, along with `vX.Y.Z` and the moving major tag `vX`, in **one atomic push**.
122
122
  3. **Publish.** It creates the GitHub Release `vX.Y.Z`, using the PR's description as the notes.
123
123
  4. **Deploy.** It calls the repo's own `.github/workflows/deploy.yml` with the new tag.
@@ -260,6 +260,16 @@ In v1, the release PR was merged with a merge commit. In v2 it ships with the `s
260
260
 
261
261
  Do steps 2–4 together. The old `release.yml` expects a merge commit, and step 3 turns merge commits off.
262
262
 
263
+ ## Skipping PR Checks on the `ship` label
264
+
265
+ Adding `ship` to the release PR doesn't need to re-run PR Checks. `actions/release` picks this up through `@v2`, but `pr-checks.yml` is the repo's own file. Per repo, by hand, because `onboard --force` would drop the repo's own jobs:
266
+
267
+ 1. In the `release-pr` job's `if`, add `&& !(github.event.action == 'labeled' && github.event.label.name == 'ship')`. Leave `work-pr` as it is.
268
+ 2. In the `if` of each of the repo's own jobs, add `&& !(github.event.action == 'labeled' && github.event.label.name == 'ship' && github.event.pull_request.head.ref == 'dev')`.
269
+ 3. Change the concurrency group to `pr-checks-${{ github.event.pull_request.number }}${{ github.event.action == 'labeled' && github.event.label.name == 'ship' && github.event.pull_request.head.ref == 'dev' && '-ship' || '' }}`.
270
+
271
+ Repos that don't change keep working, and keep re-running their checks on `ship`.
272
+
263
273
  ## Developing this repo
264
274
 
265
275
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebalzan/ci",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "One set of CI/CD rules for all your GitHub repos: reusable workflows (auto work and release PRs with AI descriptions, PR checks, semver releases), a CLI that syncs Actions config, repo settings and branch rulesets, and a commitlint commit-msg hook.",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -31,7 +31,7 @@ jobs:
31
31
  # Renovate opens and rewrites its own PR on these branches.
32
32
  if: ${{ !startsWith(github.ref_name, 'chore/renovate-') }}
33
33
  runs-on: __RUNS_ON__
34
- # Queued, never cancelled: a run cut short could leave its new PR in draft.
34
+ # Queued, never cancelled: a run cut short could leave its new PR half filled in.
35
35
  concurrency:
36
36
  group: auto-pr-${{ github.ref }}
37
37
  cancel-in-progress: false
@@ -13,9 +13,16 @@
13
13
  # The other kind is skipped, as are drafts. Keep the two job names as they are:
14
14
  # they are the check names the shared rulesets require.
15
15
  #
16
- # The PR's metadata is part of the check, so it also re-runs when the title,
17
- # description, labels, milestone or assignees change.
18
- # Add this repo's own build/test/lint jobs below; they run in parallel.
16
+ # The PR's metadata is part of the check, so it also re-runs when someone changes
17
+ # the title, description, labels, milestone or assignees. Auto PR's own edits
18
+ # start no run: on a push or a new PR, the one run waits for Auto PR to finish.
19
+ # One exception: adding `ship` to the release PR starts the Release workflow,
20
+ # which reads the result its head already has, so these jobs skip that one event.
21
+ # GitHub cannot filter a trigger by label name, and those runs get a concurrency
22
+ # group of their own, so they never cancel a real check. Every other event runs
23
+ # as usual, removing `ship` included.
24
+ # Add this repo's own build/test/lint jobs below; they run in parallel. Give each
25
+ # one the same condition as the release-pr job.
19
26
  # Generated by `ebalzan-ci onboard`; the check logic lives in the action (it
20
27
  # follows __CI_REF__).
21
28
  # =============================================================================
@@ -42,7 +49,7 @@ permissions:
42
49
  pull-requests: write
43
50
 
44
51
  concurrency:
45
- group: pr-checks-${{ github.event.pull_request.number }}
52
+ group: pr-checks-${{ github.event.pull_request.number }}${{ github.event.action == 'labeled' && github.event.label.name == 'ship' && github.event.pull_request.head.ref == 'dev' && '-ship' || '' }}
46
53
  cancel-in-progress: true
47
54
 
48
55
  env:
@@ -73,7 +80,7 @@ jobs:
73
80
 
74
81
  release-pr:
75
82
  name: pr-check / Release PR
76
- if: ${{ github.event.pull_request.head.ref == 'dev' && !github.event.pull_request.draft }}
83
+ if: ${{ github.event.pull_request.head.ref == 'dev' && !github.event.pull_request.draft && !(github.event.action == 'labeled' && github.event.label.name == 'ship') }}
77
84
  runs-on: __RUNS_ON__
78
85
  steps:
79
86
  # Full history with the tags: git-cliff computes the version from them.
@@ -96,6 +103,7 @@ jobs:
96
103
  # steps (e.g. `go test ./...`).
97
104
  # validate:
98
105
  # name: Validate
106
+ # if: ${{ !github.event.pull_request.draft && !(github.event.action == 'labeled' && github.event.label.name == 'ship' && github.event.pull_request.head.ref == 'dev') }}
99
107
  # runs-on: __RUNS_ON__
100
108
  # steps:
101
109
  # - uses: actions/checkout@v4