const CHANGELOG_COMMAND =
  "git log --pretty=format:'%aN | %s | %h' --abbrev-commit --reverse $(git describe --abbrev=0)..origin/next"

const execa = require('execa')

const TEMPLATE = `
Upgrade the Command Line Interface (CLI) with:

    npm install --global @sanity/cli

Upgrade Sanity Studio with:

    sanity upgrade

# ✨ Highlights

## Awesome feature X

A few words about the awesome feature X, preferably with screengifs

## Awesome feature Y

A few words about the awesome feature Y, preferably with screengifs

## Other features

- This is feature is not that important, but worth mentioning anyway

# 🐛 Notable bugfixes
- Fixed 🐞
- Fixed 🐛
- Fixed 🦗

# 📓 Full changelog
Author | Message | Commit
------------ | ------------- | -------------
${execa.shellSync(CHANGELOG_COMMAND).stdout}
`

console.log(`
-------- SANITY RELEASE NOTES TEMPLATE --------
Use the following template as a starting point for next release:
A draft can be created here: https://github.com/sanity-io/sanity/releases/new

-------- BEGIN TEMPLATE --------
${TEMPLATE}
-------- END TEMPLATE --------`)

@@ -630,17 +630,17 @@
 s%0A- Fixe
-d
+s
  %F0%9F%90%9E%0A- Fix
@@ -640,17 +640,17 @@
 %F0%9F%90%9E%0A- Fixe
-d
+s
  %F0%9F%90%9B%0A- Fix
@@ -650,17 +650,17 @@
 %F0%9F%90%9B%0A- Fixe
-d
+s
  %F0%9F%A6%97%0A%0A# %F0%9F%93%93 
@@ -793,16 +793,55 @@
 out%7D%0A%60%0A%0A
+// eslint-disable-next-line no-console%0A
 console.

change bug list in release notes template to start with `Fixes` instead of `Fixed`