@rightkit/git 0.2.9 → 0.2.11

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/cli/right-git.mjs CHANGED
File without changes
package/manifest.mjs CHANGED
@@ -641,7 +641,8 @@ function releaseChainJobs(manifest, pm, artifactPrefix) {
641
641
  - name: Fail closed when protected finalization is absent
642
642
  if: \${{ needs.windows-sign.result != 'success' }}
643
643
  shell: pwsh
644
- run: throw 'installed_qualification_failed { reason: prerequisites_absent, detail: "same-run Windows signing/finalization did not succeed" }'
644
+ run: |
645
+ throw 'installed_qualification_failed { reason: prerequisites_absent, detail: "same-run Windows signing/finalization did not succeed" }'
645
646
  - name: Download same-run finalized Windows release
646
647
  uses: actions/download-artifact@${DOWNLOAD_ARTIFACT_SHA} # v4.3.0
647
648
  with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/git",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Public-repo-only GitHub Actions workflow layer: templates, visibility gate, sync/drift/adopt/uninstall for right-git.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -15,6 +15,9 @@
15
15
  "*.json"
16
16
  ],
17
17
  "sideEffects": false,
18
+ "scripts": {
19
+ "test": "node --test *.test.mjs"
20
+ },
18
21
  "publishConfig": {
19
22
  "registry": "https://registry.npmjs.org/",
20
23
  "access": "public"
@@ -24,7 +27,5 @@
24
27
  "url": "git+https://github.com/bogusyogi/claude.git",
25
28
  "directory": "tools/rightkit/packages/git"
26
29
  },
27
- "scripts": {
28
- "test": "node --test *.test.mjs"
29
- }
30
- }
30
+ "packageManager": "pnpm@11.24.0"
31
+ }
package/render.mjs CHANGED
@@ -31,5 +31,8 @@ export function renderTemplate(templateText, context) {
31
31
  if (leftover) {
32
32
  throw new Error(`render: unresolved placeholder ${leftover[0]} remained after substitution`);
33
33
  }
34
- return rendered;
34
+ // Optional final job fragments may expand to an empty string. Normalize
35
+ // template EOF after substitution so managed workflows remain byte-stable
36
+ // with exactly one terminating newline.
37
+ return `${rendered.replace(/(?:\r\n|\r|\n)+$/, "")}\n`;
35
38
  }
package/render.test.mjs CHANGED
@@ -203,6 +203,8 @@ test("rust-hybrid release chain preserves signed candidate, installed qualificat
203
203
  assert.match(content, /macos-sign:[\s\S]*pnpm run release:finalize:mac/);
204
204
  assert.match(content, /installed-qualification:\n needs: \[candidate, windows-sign\]/);
205
205
  assert.match(content, /installed_qualification_failed/);
206
+ assert.match(content, /shell: pwsh\n run: \|\n throw 'installed_qualification_failed \{ reason: prerequisites_absent, detail: "same-run Windows signing\/finalization did not succeed" \}'/);
207
+ assert.doesNotMatch(content, /^ run: throw 'installed_qualification_failed .*detail: /m);
206
208
  assert.match(content, /pnpm run release:qualify:installed/);
207
209
  assert.match(content, /publish:\n needs: \[installed-qualification, macos-sign\]/);
208
210
  assert.match(content, /needs\.macos-sign\.result == 'success'/);
@@ -320,3 +322,9 @@ test("renderTemplate never substitutes inside GitHub Actions double-brace expres
320
322
  const out = renderTemplate("run: echo ${{ github.repository }}\nname: ${TEMPLATE_VERSION}\n", { TEMPLATE_VERSION: "1.0.0" });
321
323
  assert.equal(out, "run: echo ${{ github.repository }}\nname: 1.0.0\n");
322
324
  });
325
+
326
+ test("renderTemplate normalizes an empty final release-chain fragment to one newline", () => {
327
+ const out = renderTemplate("jobs:\n${RELEASE_CHAIN_JOBS}\n", { RELEASE_CHAIN_JOBS: "" });
328
+ assert.equal(out, "jobs:\n");
329
+ assert.equal((out.match(/\n/g) ?? []).length, 1);
330
+ });