@moku-labs/ci 1.5.5 → 1.5.6
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
|
@@ -120,7 +120,7 @@ flowchart LR
|
|
|
120
120
|
| [`rulesets/main.json`](rulesets/main.json) | Branch ruleset for `main`: PR only, no force-push, the four `ci / …` checks required. |
|
|
121
121
|
| [`examples/dependabot.yml`](examples/dependabot.yml) | Dependabot config: one grouped PR a day for `@moku-labs/*` only. `setup` writes it to `.github/dependabot.yml`. |
|
|
122
122
|
| [`examples/org/fleet.yml`](examples/org/fleet.yml) | For the organization's `.github` repository. Every 15 minutes it runs `moku-release fleet --markdown --deps` and puts the table between `<!-- fleet:start -->` and `<!-- fleet:end -->` of `profile/README.md`. |
|
|
123
|
-
| [`examples/package/dependabot-automerge.yml`](examples/package/dependabot-automerge.yml) | Turns on auto-merge for a Dependabot PR; the ruleset checks stay the gate. After the merge it dispatches `publish.yml` with `patch`, because a merge made by `GITHUB_TOKEN` starts no push run. `setup` writes it and allows auto-merge on the repo. |
|
|
123
|
+
| [`examples/package/dependabot-automerge.yml`](examples/package/dependabot-automerge.yml) | Turns on auto-merge for a Dependabot PR; the ruleset checks stay the gate. After the merge it dispatches `publish.yml` with `patch`, because a merge made by `GITHUB_TOKEN` starts no push run. A bump of `devDependencies` alone dispatches nothing: the published package is the same, and two packages that pin each other would release each other forever. `setup` writes it and allows auto-merge on the repo. |
|
|
124
124
|
|
|
125
125
|
> [!TIP]
|
|
126
126
|
> A Layer-3 app copies `examples/app/ci.yml` and `examples/dependabot.yml` by hand and needs
|
|
@@ -3,7 +3,8 @@ name: Dependabot automerge
|
|
|
3
3
|
# Turns on auto-merge for a Dependabot PR. The branch ruleset stays the gate: the merge
|
|
4
4
|
# waits for ci / lint, ci / types, ci / test and ci / build. Needs the repo setting
|
|
5
5
|
# allow_auto_merge, which `moku-release setup` turns on. After the merge it dispatches
|
|
6
|
-
# publish.yml, so a Dependabot merge releases a patch like any other merge.
|
|
6
|
+
# publish.yml, so a Dependabot merge releases a patch like any other merge. A bump of
|
|
7
|
+
# devDependencies alone releases nothing: the published package did not change.
|
|
7
8
|
on: pull_request
|
|
8
9
|
|
|
9
10
|
# One waiter per PR: a rebase of the PR starts a new run and ends the old one.
|
|
@@ -23,6 +24,8 @@ jobs:
|
|
|
23
24
|
env:
|
|
24
25
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
25
26
|
REPO: ${{ github.repository }}
|
|
27
|
+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
28
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
26
29
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
27
30
|
steps:
|
|
28
31
|
- name: Merge once required checks pass
|
|
@@ -33,6 +36,17 @@ jobs:
|
|
|
33
36
|
# the merge, then dispatch the same patch a push would have cut.
|
|
34
37
|
run: |
|
|
35
38
|
set -euo pipefail
|
|
39
|
+
# A devDependency is not part of the published package. Releasing its bump would
|
|
40
|
+
# make every package that pins this one release too, and two packages that pin
|
|
41
|
+
# each other would release each other forever.
|
|
42
|
+
published() {
|
|
43
|
+
gh api "repos/$REPO/contents/package.json?ref=$1" --jq .content | base64 -d \
|
|
44
|
+
| jq -S '{dependencies, peerDependencies, optionalDependencies}'
|
|
45
|
+
}
|
|
46
|
+
if [ "$(published "$BASE_SHA")" = "$(published "$HEAD_SHA")" ]; then
|
|
47
|
+
echo "only devDependencies moved: the published package is the same, no release"
|
|
48
|
+
exit 0
|
|
49
|
+
fi
|
|
36
50
|
for _ in $(seq 1 90); do
|
|
37
51
|
state="$(gh pr view "$PR_URL" --json state --jq .state)"
|
|
38
52
|
case "$state" in
|