Use of `#` in commit body causes `closes` false positive

Author: myiiCreated Feb 27, 2019Updated Apr 14, 2022
Labelssupport

Notes:

  • This was first opened as an issue against semantic-release.
  • This may be a duplicate of #391.

Current behavior

Had this happen a few times now but manually fixed previously. If a hash # appears in the commit body, it is seen as a closes in the release notes and changelog. An existing example follows.

Commit https://github.com/saltstack-formulas/template-formula/commit/3a072c7:

ci(travis): prevent `release` stage running for PRs

* The `release` stage will always fail due to security reasons:
  - E.g. https://travis-ci.com/saltstack-formulas/template-formula/jobs/180068519#L466.
  - Discussed: #42 (comment).
* The `release` stage is unnecessary for PRs until the merge to `master`, in any case.

Resulted in both:

Specifically:

Expected behavior

The closes shouldn't have been present:

  • travis: prevent release stage running for PRs (3a072c7)

Environment

Further example that was manually fixed

Source: conventional-changelog/conventional-changelog