Skip to content

fix(release): run the deduper from a path that survives the checkout - #211

Merged
derrickmehaffy merged 1 commit into
mainfrom
fix/dedupe-script-path
Aug 14, 2026
Merged

derrickmehaffy merged 1 commit into
mainfrom
fix/dedupe-script-path

Conversation

@derrickmehaffy

Copy link
Copy Markdown
Contributor

#210's step failed on its first real run — the wiring I flagged as untested.

Error: Cannot find module '/home/runner/work/plugin-rest-cache/plugin-rest-cache/scripts/dedupe-changelog.mjs'

It checks out the release branch, and that branch was cut from 3498f3a —
before the script existed. So it checked out a tree without its own script
in it.

Fix: copy the script to $RUNNER_TEMP before touching the working tree.

A second bug, found by rehearsing properly

Rather than ship untested wiring twice, I replayed the step verbatim against the
real release-please--branches--main. That surfaced a failure the first run
never got far enough to hit:

error: Your local changes to the following files would be overwritten by checkout:
	CHANGELOG.md
Aborting

git checkout - aborts while CHANGELOG.md is dirty. It was only switching
back out of tidiness — step 2 runs entirely through the API with the script
already copied out — so it no longer switches back.

Verified

The step, run verbatim, against the actual release branch:

removed 11 duplicate entries:
  - add a cache statistics endpoint for the admin dashboard
  - add an opt-in content api purge endpoint
  ... (9 more)
committed OK: 85ec3c5 chore: drop duplicate changelog entries
step completed, exit=0

Note

The failure was contained, as designed: it runs after release-please, so #209
was still updated correctly — only the deduplication was skipped. #209 currently
has 73 changelog entries; merging this drops it to 62.

Touches a workflow, so it needs a maintainer to merge.

🤖 Generated with Claude Code

The step failed on its first real run:

  Error: Cannot find module '.../scripts/dedupe-changelog.mjs'

It checks out the release branch, and that branch is cut from whatever main was
when release-please first opened the pull request - which predates the script.
So it checked out a tree without its own script in it.

Copy the script to $RUNNER_TEMP before touching the working tree, and run it
from there.

Rehearsing the step locally against the real release branch also turned up a
second failure the first run never reached: `git checkout -` aborts with "Your
local changes would be overwritten" when CHANGELOG.md is still dirty. It only
switched back out of tidiness - step 2 works entirely through the API, with the
script already copied out - so it no longer switches back at all.

Verified by running the step verbatim against release-please--branches--main:
11 duplicates removed, commit created, exit 0.

Co-Authored-By: Claude <noreply@anthropic.com>
@derrickmehaffy
derrickmehaffy merged commit 06c5f8f into main Aug 14, 2026
12 checks passed
This was referenced Aug 14, 2026
@derrickmehaffy
derrickmehaffy deleted the fix/dedupe-script-path branch August 14, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant