@rightkit/release 0.2.148 → 0.2.149

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.148",
3
+ "version": "0.2.149",
4
4
  "description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
package/release.mjs CHANGED
@@ -743,7 +743,7 @@ async function validateHostedWorkflows(root, appName, workflows, policy) {
743
743
  }
744
744
  const lanes = manifest?.lanes;
745
745
  // Mirrors the `lanes` enum in @rightkit/git manifest.schema.json.
746
- const safeLanes = new Set(["ci", "qualification", "package-smoke", "release-candidate", "publish-npm", "publish-package-managers"]);
746
+ const safeLanes = new Set(["ci", "qualification", "package-smoke", "release-candidate", "publish-npm", "publish-package-managers", "regenerate"]);
747
747
  if (manifest?.schemaVersion !== 1
748
748
  || manifest?.compile !== "github-actions-only"
749
749
  || !Array.isArray(lanes)
@@ -802,6 +802,22 @@ async function validateHostedWorkflows(root, appName, workflows, policy) {
802
802
  // @rightkit/git `devArtifact.mac: "sign"` renders a `dev-mac-sign` job into
803
803
  // the managed ci.yml: push to the default branch only, release environment,
804
804
  // Developer ID certificate secrets only (no notarization keys).
805
+ // @rightkit/git `regenerate` lane: manual-only, opens a pull request from a
806
+ // right-git/regenerate-<run> branch and never writes to the default branch.
807
+ // `contents: write` and `pull-requests: write` are accepted only inside that
808
+ // job, only when the manifest declares `regenerate`, and only when the
809
+ // workflow has no trigger other than workflow_dispatch and pushes solely to
810
+ // the right-git/regenerate-* branch namespace.
811
+ const regenerateSpan = workflow === "regenerate.yml" ? jobSpan("regenerate") : null;
812
+ const regenerateSource = regenerateSpan ? source.slice(regenerateSpan.start, regenerateSpan.end) : "";
813
+ const protectedRegenerate = workflow === "regenerate.yml"
814
+ && manifest?.regenerate && typeof manifest.regenerate.script === "string"
815
+ && /^on:\n workflow_dispatch:\n(?! )/m.test(source)
816
+ && /regenerate:\n needs: \[private-repo-guard\]\n if: \$\{\{ github\.event_name == 'workflow_dispatch' \}\}\n/.test(regenerateSource)
817
+ && /branch="right-git\/regenerate-\$\{\{ github\.run_id \}\}-\$\{\{ github\.run_attempt \}\}"\n/.test(regenerateSource)
818
+ && /git push origin "HEAD:refs\/heads\/\$branch"\n/.test(regenerateSource)
819
+ && !/git push(?![^\n]*"HEAD:refs\/heads\/\$branch")/.test(regenerateSource);
820
+ const allowedRegeneratePermissions = new Set(["contents", "pull-requests"]);
805
821
  const devMacSpan = workflow === "ci.yml" ? jobSpan("dev-mac-sign") : null;
806
822
  const devMacSource = devMacSpan ? source.slice(devMacSpan.start, devMacSpan.end) : "";
807
823
  const allowedDevMacSecrets = new Set(["APPLE_CERTIFICATE_BASE64", "APPLE_CERTIFICATE_PASSWORD", "APPLE_KEYCHAIN_PASSWORD"]);
@@ -825,9 +841,12 @@ async function validateHostedWorkflows(root, appName, workflows, policy) {
825
841
  && (legacyReleasePublishGate || admittedReleasePublishGate)
826
842
  && /\n permissions:\n contents: write\n/.test(publishSource);
827
843
  if (/^\s*permissions:\s*write-all\s*$/mi.test(source)
828
- || writePermissions.some(({ name, index }) => name === "id-token"
829
- ? !(protectedWindowsSigning && inside(index, windowsSpan))
830
- : name !== "contents" || !protectedReleasePublish || !inside(index, publishSpan))
844
+ || writePermissions.some(({ name, index }) => {
845
+ if (protectedRegenerate && inside(index, regenerateSpan) && allowedRegeneratePermissions.has(name)) return false;
846
+ return name === "id-token"
847
+ ? !(protectedWindowsSigning && inside(index, windowsSpan))
848
+ : name !== "contents" || !protectedReleasePublish || !inside(index, publishSpan);
849
+ })
831
850
  || /pull_request_target\s*:/i.test(source)
832
851
  || /\bsecrets\s*\[/i.test(source)
833
852
  || requestedSecrets.some(({ name, index }) => !(protectedMacosSigning && inside(index, macosSpan) && allowedMacosSecrets.has(name))
@@ -16,7 +16,7 @@
16
16
  "@rightkit/app-shell": "0.3.0",
17
17
  "@rightkit/ax": "0.2.4",
18
18
  "@rightkit/doc-render": "0.1.4",
19
- "@rightkit/git": "0.2.34",
19
+ "@rightkit/git": "0.2.36",
20
20
  "@rightkit/hooks": "0.1.2",
21
21
  "@rightkit/i18n": "0.1.0",
22
22
  "@rightkit/legal": "0.3.1",
@@ -29,7 +29,7 @@
29
29
  "@rightkit/platform-ui": "0.2.0",
30
30
  "@rightkit/qa": "0.4.0",
31
31
  "@rightkit/qa-chrome": "0.1.3",
32
- "@rightkit/release": "0.2.148",
32
+ "@rightkit/release": "0.2.149",
33
33
  "@rightkit/settings-ui": "0.3.0",
34
34
  "@rightkit/shell": "0.1.0",
35
35
  "@rightkit/tauri": "0.2.0",
@@ -75,7 +75,9 @@
75
75
  "0.2.30",
76
76
  "0.2.31",
77
77
  "0.2.32",
78
- "0.2.33"
78
+ "0.2.33",
79
+ "0.2.34",
80
+ "0.2.35"
79
81
  ],
80
82
  "@rightkit/legal-ui": [
81
83
  "0.1.0",
@@ -181,7 +183,8 @@
181
183
  "0.2.144",
182
184
  "0.2.145",
183
185
  "0.2.146",
184
- "0.2.147"
186
+ "0.2.147",
187
+ "0.2.148"
185
188
  ],
186
189
  "@rightkit/qa": [
187
190
  "0.1.0",
@@ -380,7 +383,7 @@
380
383
  "@rightkit/app-shell": "0.3.0",
381
384
  "@rightkit/ax": "0.2.4",
382
385
  "@rightkit/doc-render": "0.1.4",
383
- "@rightkit/git": "0.2.34",
386
+ "@rightkit/git": "0.2.36",
384
387
  "@rightkit/hooks": "0.1.2",
385
388
  "@rightkit/i18n": "0.1.0",
386
389
  "@rightkit/legal": "0.3.1",
@@ -393,7 +396,7 @@
393
396
  "@rightkit/platform-ui": "0.2.0",
394
397
  "@rightkit/qa": "0.4.0",
395
398
  "@rightkit/qa-chrome": "0.1.3",
396
- "@rightkit/release": "0.2.147",
399
+ "@rightkit/release": "0.2.148",
397
400
  "@rightkit/settings-ui": "0.3.0",
398
401
  "@rightkit/shell": "0.1.0",
399
402
  "@rightkit/tauri": "0.2.0",