git icon indicating copy to clipboard operation
git copied to clipboard

branch variable does not match documentation

Open hanseltime opened this issue 2 years ago • 0 comments

So I recently came across an issue where my commit message couldn't actually include "branch.name".

Upon further investigation, I found this section of the prepare code: https://github.com/semantic-release/git/blob/09200b1612cf4588ce7836b87a3fa31317c38783/lib/prepare.js#L65

    await commit(
      message
        ? template(message)({branch: branch.name, lastRelease, nextRelease})
        : `chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}`,
      {env, cwd}
    );

It looks like we've historically been adding branch as just the branch name. Before I submit a PR, it seems there are two ways that this can go:

  1. change the README to say that only "branch" is available for the message as the branch name
  2. make branch the object intended with some sort of backwards compatibility for any semantic-release versions (or just make it a major version bump)

I wanted to report this as an issue before trying to submit a PR that makes the opinion.

hanseltime avatar Mar 15 '23 01:03 hanseltime