Skip to content

prepare-release.mjs breaks relative doc links when copying CHANGELOG entries into docs/releases/ #86

Description

@mostlydev

scripts/prepare-release.mjs copies ## Unreleased entries verbatim from CHANGELOG.md into docs/releases/<version>.md. Those two files sit at different depths, so any link written relative to the repo root resolves one directory too deep once copied.

Hit while cutting 0.20.0: a CHANGELOG entry linking [\docs/reference.md`](docs/reference.md)becamedocs/releases/docs/reference.md` in the generated notes. Caught in review and fixed by hand in 994d70b, but the next release with a doc link will reproduce it.

Options: rewrite relative links while copying (prefix ../ for paths that are not already relative or absolute), or validate the generated notes and fail the release script on a broken relative link. The second also catches links that were wrong in the CHANGELOG to begin with.

Worth a link check in CI over README.md, CHANGELOG.md, docs/** generally — one existed only as an ad-hoc script during the 0.20.0 docs work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions