async function getReleaseNotes(version, releaseNotesFile) {
  console.log('Retrieving release notes from file: ', releaseNotesFile)

  const data = await readReleaseNoteFile(releaseNotesFile)

  const sections = data.split(/^### /m)
  // Iterate over all past releases to find the version we want
  const versionChangeLog = sections.find((section) => section.startsWith(version))
  // e.g. v7.1.2 (2021-02-24)\n\n
  const headingRegex = /^v\d+\.\d+\.\d+ \((\d{4}-\d{2}-\d{2})\)\s+/
  const body = versionChangeLog.replace(headingRegex, '') + SUPPORT_STATEMENT
  const [, releaseDate] = headingRegex.exec(versionChangeLog)

  return { body, releaseDate }
}
Extracts the relevant changes from the NEWS.md

@param {string} version the new version
@param {string} releaseNotesFile the filename where the release notes are stored