@biffo/cli 0.147.0 → 0.148.0
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.
|
@@ -66,7 +66,39 @@ repo; only its product differs.
|
|
|
66
66
|
before merge: `git log origin/<branch> -1`. A green PR page is not proof your
|
|
67
67
|
latest local commit reached it.
|
|
68
68
|
|
|
69
|
-
## 7.
|
|
69
|
+
## 7. Creating this repo correctly (read once, at birth)
|
|
70
|
+
|
|
71
|
+
**No `biffo` command creates a standalone plugin repo.** `biffo plugin create`
|
|
72
|
+
scaffolds a plugin _into an existing checkout_; a repo like this one is made by
|
|
73
|
+
hand. So the governance that `biffo init` and `biffo sibling create` apply
|
|
74
|
+
automatically is **not applied here**, and has to be set deliberately.
|
|
75
|
+
|
|
76
|
+
That gap is not theoretical: both existing plugin repos ran with **no branch
|
|
77
|
+
protection at all**, and `biffo-plugin-ideation#54` was merged with both CI jobs
|
|
78
|
+
still in progress because nothing stopped it (biffo-template#714).
|
|
79
|
+
|
|
80
|
+
After creating the repo and pushing this skeleton:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 1. Auto-merge must be ON, or `gh pr merge --auto` merges IMMEDIATELY
|
|
84
|
+
# rather than queuing — see the warning below.
|
|
85
|
+
gh api -X PATCH repos/<org>/<repo> -f allow_auto_merge=true -f delete_branch_on_merge=true
|
|
86
|
+
|
|
87
|
+
# 2. Protect dev, deriving the required checks from what CI actually reports.
|
|
88
|
+
# Run it once CI has gone green at least twice, so there is something to derive from.
|
|
89
|
+
biffo check branch-protection --repo <org>/<repo> --fix
|
|
90
|
+
|
|
91
|
+
# 3. Confirm it took.
|
|
92
|
+
biffo check branch-protection --repo <org>/<repo>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
> **`--auto` is not a safety net on an unconfigured repo.** With
|
|
96
|
+
> `allow_auto_merge` disabled, `gh pr merge --squash --auto` does not queue — it
|
|
97
|
+
> merges _now_ if the PR is mergeable at that instant. On an unprotected branch
|
|
98
|
+
> that means merging with checks still running. Steps 1 and 2 together are what
|
|
99
|
+
> make the documented flow behave as documented; either alone is not enough.
|
|
100
|
+
|
|
101
|
+
## 8. CI runners — two steps this repo cannot do for itself
|
|
70
102
|
|
|
71
103
|
The workflows use `runs-on: ${{ vars.RUNNER_LABEL || 'ubuntu-latest' }}`, so they
|
|
72
104
|
work anywhere by default and route to a self-hosted fleet when one exists. Two
|
|
@@ -83,7 +115,7 @@ fleet:
|
|
|
83
115
|
If a job is queued and nothing is happening, check the grant before anything
|
|
84
116
|
else. It is the failure that looks exactly like patience.
|
|
85
117
|
|
|
86
|
-
##
|
|
118
|
+
## 9. Security
|
|
87
119
|
|
|
88
120
|
- **Never commit secrets** (keys, tokens, credentials, `.env` values).
|
|
89
121
|
- **Never silently disable a security gate.** If one must be loosened, do it in
|
package/dist/index.js
CHANGED
|
@@ -638,6 +638,10 @@ var DEFAULT_STATUS_CHECKS = [
|
|
|
638
638
|
"Secret Scan",
|
|
639
639
|
"Terraform Validate & Security"
|
|
640
640
|
];
|
|
641
|
+
var REPO_MERGE_SETTINGS = {
|
|
642
|
+
allow_auto_merge: true,
|
|
643
|
+
delete_branch_on_merge: true
|
|
644
|
+
};
|
|
641
645
|
var GitHubAdapter = class {
|
|
642
646
|
octokit;
|
|
643
647
|
templateOwner;
|
|
@@ -775,6 +779,7 @@ var GitHubAdapter = class {
|
|
|
775
779
|
org,
|
|
776
780
|
name: repo,
|
|
777
781
|
private: true,
|
|
782
|
+
...REPO_MERGE_SETTINGS,
|
|
778
783
|
...description !== void 0 ? { description } : {}
|
|
779
784
|
});
|
|
780
785
|
log.success(`Repository created: ${data2.html_url}`);
|
|
@@ -785,6 +790,7 @@ var GitHubAdapter = class {
|
|
|
785
790
|
const { data } = await this.octokit.repos.createForAuthenticatedUser({
|
|
786
791
|
name: repo,
|
|
787
792
|
private: true,
|
|
793
|
+
...REPO_MERGE_SETTINGS,
|
|
788
794
|
...description !== void 0 ? { description } : {}
|
|
789
795
|
});
|
|
790
796
|
log.success(`Repository created: ${data.html_url}`);
|