@wipcomputer/wip-release 1.9.63 → 1.9.65

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.
Files changed (2) hide show
  1. package/core.mjs +19 -2
  2. package/package.json +1 -1
package/core.mjs CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { execSync, execFileSync } from 'node:child_process';
9
9
  import { readFileSync, writeFileSync, existsSync, readdirSync, mkdirSync, renameSync } from 'node:fs';
10
- import { join, basename } from 'node:path';
10
+ import { join, basename, dirname } from 'node:path';
11
11
 
12
12
  // ── Version ─────────────────────────────────────────────────────────
13
13
 
@@ -1184,7 +1184,24 @@ export async function release({ repoPath, level, notes, notesSource, dryRun, noP
1184
1184
  console.log(` ✗ Release notes blocked:`);
1185
1185
  for (const issue of notesCheck.issues) console.log(` - ${issue}`);
1186
1186
  console.log('');
1187
- // Scaffold a template so the agent has something to fill in
1187
+ // Only scaffold on feature branches. On main, scaffolding leaves an
1188
+ // untracked file that branch guards prevent removing (#223).
1189
+ let currentBranch = '';
1190
+ try {
1191
+ currentBranch = execFileSync('git', ['branch', '--show-current'], {
1192
+ cwd: repoPath, encoding: 'utf8'
1193
+ }).trim();
1194
+ } catch {}
1195
+
1196
+ const isProtectedBranch = currentBranch === 'main' || currentBranch === 'master';
1197
+
1198
+ if (isProtectedBranch) {
1199
+ console.log(` Release notes missing. Write RELEASE-NOTES-v${newVersion.replace(/\./g, '-')}.md on your feature branch before merging.`);
1200
+ console.log('');
1201
+ return { currentVersion, newVersion, dryRun: false, failed: true };
1202
+ }
1203
+
1204
+ // Feature branch: scaffold a template so the agent has something to fill in
1188
1205
  const templatePath = scaffoldReleaseNotes(repoPath, newVersion);
1189
1206
  console.log(` Scaffolded template: ${basename(templatePath)}`);
1190
1207
  console.log(' Fill it in, commit, then run wip-release again.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-release",
3
- "version": "1.9.63",
3
+ "version": "1.9.65",
4
4
  "type": "module",
5
5
  "description": "One-command release pipeline. Bumps version, updates changelog + SKILL.md, publishes to npm + GitHub.",
6
6
  "main": "core.mjs",