Repository: release-drafter/release-drafter
Pull request #1066 (2022-02-13 05:42:42)

Improve contribution docs and remove unused package script
## Motivation

I would like to contribute to this project to support mono-repo features like # 997. However, there are some obstacles that are difficult to contribute to this project, so we'll fix them first.


Patch:
diff --git a/.gitignore b/.gitignore
index 5055959..b00154f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,22 @@ docker-compose-logs
 package-lock.json
 dist/static/
 dist/views/
+
+# OS
+.DS_Store
+
+# IDE - VSCode
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+# IDEs and editors
+/.idea
+.project
+.classpath
+.c9/
+*.launch
+.settings/
+*.sublime-workspace
diff --git a/README.md b/README.md
index d1d7d81..d21e838 100644
--- a/README.md
+++ b/README.md
@@ -106,31 +106,31 @@ template: |
 
 You can configure Release Drafter using the following key in your `.github/release-drafter.yml` file:
 
-| Key                        | Required | Description                                                                                                                                                                |
-| -------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `template`                 | Required | The template for the body of the draft release. Use [template variables](#template-variables) to insert values.                                                            |
-| `header`                   | Optional | Will be prepended to `template`. Use [template variables](#template-variables) to insert values.                                                                           |
-| `footer`                   | Optional | Will be appended to `template`. Use [template variables](#template-variables) to insert values.                                                                            |
-| `category-template`        | Optional | The template to use for each category. Use [category template variables](#category-template-variables) to insert values. Default: `"## $TITLE"`.                           |
-| `name-template`            | Optional | The template for the name of the draft release. For example: `"v$NEXT_PATCH_VERSION"`.                                                                                     |
-| `tag-template`             | Optional | The template for the tag of the draft release. For example: `"v$NEXT_PATCH_VERSION"`.                                                                                      |
-| `version-template`         | Optional | The template to use when calculating the next version number for the release. Useful for projects that don't use semantic versioning. Default: `"$MAJOR.$MINOR.$PATCH"`    |
-| `change-template`          | Optional | The template to use for each merged pull request. Use [change template variables](#change-template-variables) to insert values. Default: `"* $TITLE (#$NUMBER) @$AUTHOR"`. |
-| `change-title-escapes`     | Optional | Characters to escape in `$TITLE` when inserting into `change-template` so that they are not interpreted as Markdown format characters. Default: `""`                       |
-| `no-changes-template`      | Optional | The template to use for when there’s no changes. Default: `"* No changes"`.                                                                                                |
-| `references`               | Optional | The references to listen for configuration updates to `.github/release-drafter.yml`. Refer to [References](#references) to learn more about this                           |
-| `categories`               | Optional | Categorize pull requests using labels. Refer to [Categorize Pull Requests](#categorize-pull-requests) to learn more about this option.                                     |
-| `exclude-labels`           | Optional | Exclude pull requests using labels. Refer to [Exclude Pull Requests](#exclude-pull-requests) to learn more about this option.                                              |
-| `include-labels`           | Optional | Include only the specified pull requests using labels. Refer to [Include Pull Requests](#include-pull-requests) to learn more about this option.                           |
-| `exclude-contributors`     | Optional | Exclude specific usernames from the generated `$CONTRIBUTORS` variable. Refer to [Exclude Contributors](#exclude-contributors) to learn more about this option.            |
-| `no-contributors-template` | Optional | The template to use for `$CONTRIBUTORS` when there's no contributors to list. Default: `"No contributors"`.                                                                |
-| `replacers`                | Optional | Search and replace content in the generated changelog body. Refer to [Replacers](#replacers) to learn more about this option.                                              |
-| `sort-by`                  | Optional | Sort changelog by merged_at or title. Can be one of: `merged_at`, `title`. Default: `merged_at`.                                                                           |
-| `sort-direction`           | Optional | Sort changelog in ascending or descending order. Can be one of: `ascending`, `descending`. Default: `descending`.                                                          |
-| `prerelease`               | Optional | Mark the draft release as pre-release. Default `false`.                                                                                                                    |
-| `version-resolver`         | Optional | Adjust the `$RESOLVED_VERSION` variable using labels. Refer to [Version Resolver](#version-resolver) to learn more about this                                              |
-| `filter-by-commitish`      | Optional | Filter previous releases to consider only the target branch of the release. Default: `false`.                                                                              |
-| `commitish`                | Optional | Specify the target branch of the release. Default: the default branch of the repo.                                                                                         |
+| Key                        | Required | Description                                                                                                                                                                        |
+| -------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `template`                 | Required | The template for the body of the draft release. Use [template variables](#template-variables) to insert values.                                                                    |
+| `header`                   | Optional | Will be prepended to `template`. Use [template variables](#template-variables) to insert values.                                                                                   |
+| `footer`                   | Optional | Will be appended to `template`. Use [template variables](#template-variables) to insert values.                                                                                    |
+| `category-template`        | Optional | The template to use for each category. Use [category template variables](#category-template-variables) to insert values. Default: `"## $TITLE"`.                                   |
+| `name-template`            | Optional | The template for the name of the draft release. For example: `"v$NEXT_PATCH_VERSION"`.                                                                                             |
+| `tag-template`             | Optional | The template for the tag of the draft release. For example: `"v$NEXT_PATCH_VERSION"`.                                                                                              |
+| `version-template`         | Optional | The template to use when calculating the next version number for the release. Useful for projects that don't use semantic versioning. Default: `"$MAJOR.$MINOR.$PATCH"`            |
+| `change-template`          | Optional | The template to use for each merged pull request. Use [change template variables](#change-template-variables) to insert values. Default: `"* $TITLE (#$NUMBER) @$AUTHOR"`.         |
+| `change-title-escapes`     | Optional | Characters to escape in `$TITLE` when inserting into `change-template` so that they are not interpreted as Markdown format characters. Default: `""`                               |
+| `no-changes-template`      | Optional | The template to use for when there’s no changes. Default: `"* No changes"`.                                                                                                        |
+| `references`               | Optional | The references to listen for configuration updates to `.github/release-drafter.yml`. Refer to [References](#references) to learn more about this                                   |
+| `categories`               | Optional | Categorize pull requests using labels. Refer to [Categorize Pull Requests](#categorize-pull-requests) to learn more about this option.                                             |
+| `exclude-labels`           | Optional | Exclude pull requests using labels. Refer to [Exclude Pull Requests](#exclude-pull-requests) to learn more about this option.                                                      |
+| `include-labels`           | Optional | Include only the specified pull requests using labels. Refer to [Include Pull Requests](#include-pull-requests) to learn more about this option.                                   |
+| `exclude-contributors`     | Optional | Exclude specific usernames from the generated `$CONTRIBUTORS` variable. Refer to [Exclude Contributors](#exclude-contributors) to learn more about this option.                    |
+| `no-contributors-template` | Optional | The template to use for `$CONTRIBUTORS` when there's no contributors to list. Default: `"No contributors"`.                                                                        |
+| `replacers`                | Optional | Search and replace content in the generated changelog body. Refer to [Replacers](#replacers) to learn more about this option.                                                      |
+| `sort-by`                  | Optional | Sort changelog by merged_at or title. Can be one of: `merged_at`, `title`. Default: `merged_at`.                                                                                   |
+| `sort-direction`           | Optional | Sort changelog in ascending or descending order. Can be one of: `ascending`, `descending`. Default: `descending`.                                                                  |
+| `prerelease`               | Optional | Mark the draft release as pre-release. Default `false`.                                                                                                                            |
+| `version-resolver`         | Optional | Adjust the `$RESOLVED_VERSION` variable using labels. Refer to [Version Resolver](#version-resolver) to learn more about this                                                      |
+| `commitish`                | Optional | The release target, i.e. branch or commit it should point to. Default: the ref that release-drafter runs for, e.g. `refs/heads/master` if configured to run on pushes to `master`. |
+| `filter-by-commitish`      | Optional | Filter previous releases to consider only those with the target matching `commitish`. Default: `false`.                                                                            |
 
 Release Drafter also supports [Probot Config](https://github.com/probot/probot-config), if you want to store your configuration files in a central repository. This allows you to share configurations between projects, and create a organization-wide configuration file by creating a repository named `.github` with the file `.github/release-drafter.yml`.
 
@@ -355,13 +355,13 @@ If you have Node v10+ installed locally, you can run the tests, and a local app,
 
 ```sh
 # Install dependencies
-yarn
+yarn install
 
 # Run the tests
-npm test
+yarn test
 
 # Run the app locally
-npm run dev
+yarn test:watch
 ```
 
 Once you've started the app, visit `localhost:3000` and you'll get [step-by-step instructions](https://probot.github.io/docs/development/#configuring-a-github-app) for installing it in your GitHub account so you can start pushing commits and testing it locally.
@@ -370,7 +370,7 @@ If you don’t have Node installed, you can use [Docker Compose](https://docs.do
 
 ```sh
 # Run the tests
-docker-compose run --rm app npm test
+docker compose run --rm app
 ```
 
 ## Contributing
diff --git a/dist/index.js b/dist/index.js
index 4ab7659..ddddcea 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -128604,15 +128604,19 @@ module.exports = (app, { getRouter }) => {
       return
     }
 
+    const targetCommitish = commitish || config['commitish'] || ref
+    const filterByCommitish = config['filter-by-commitish']
+
     const { draftRelease, lastRelease } = await findReleases({
-      ref,
       context,
-      config,
+      targetCommitish,
+      filterByCommitish,
     })
+
     const { commits, pullRequests: mergedPullRequests } =
       await findCommitsWithAssociatedPullRequests({
         context,
-        ref,
+        targetCommitish,
         lastRelease,
         config,
       })
@@ -128634,7 +128638,7 @@ module.exports = (app, { getRouter }) => {
       name,
       isPreRelease,
       shouldDraft,
-      commitish,
+      targetCommitish,
     })
 
     let createOrUpdateReleaseResponse
@@ -128725,7 +128729,7 @@ const findCommitsWithAssociatedPullRequestsQuery = /* GraphQL */ `
   query findCommitsWithAssociatedPullRequests(
     $name: String!
     $owner: String!
-    $ref: String!
+    $targetCommitish: String!
     $withPullRequestBody: Boolean!
     $withPullRequestURL: Boolean!
     $since: GitTimestamp
@@ -128734,7 +128738,7 @@ const findCommitsWithAssociatedPullRequestsQuery = /* GraphQL */ `
     $withHeadRefName: Boolean!
   ) {
     repository(name: $name, owner: $owner) {
-      object(expression: $ref) {
+      object(expression: $targetCommitish) {
         ... on Commit {
           history(first: 100, since: $since, after: $after) {
             totalCount
@@ -128786,7 +128790,7 @@ const findCommitsWithAssociatedPullRequestsQuery = /* GraphQL */ `
 
 const findCommitsWithAssociatedPullRequests = async ({
   context,
-  ref,
+  targetCommitish,
   lastRelease,
   config,
 }) => {
@@ -128794,7 +128798,7 @@ const findCommitsWithAssociatedPullRequests = async ({
   const variables = {
     name: repo,
     owner,
-    ref,
+    targetCommitish,
     withPullRequestBody: config['change-template'].includes('$BODY'),
     withPullRequestURL: config['change-template'].includes('$URL'),
     withBaseRefName: config['change-template'].includes('$BASE_REF_NAME'),
@@ -128807,7 +128811,7 @@ const findCommitsWithAssociatedPullRequests = async ({
   if (lastRelease) {
     log({
       context,
-      message: `Fetching all commits for reference ${ref} since ${lastRelease.created_at}`,
+      message: `Fetching parent commits of ${targetCommitish} since ${lastRelease.created_at}`,
     })
 
     data = await paginate(
@@ -128822,7 +128826,7 @@ const findCommitsWithAssociatedPullRequests = async ({
       (commit) => commit.committedDate != lastRelease.created_at
     )
   } else {
-    log({ context, message: `Fetching all commits for reference ${ref}` })
+    log({ context, message: `Fetching parent commits of ${targetCommitish}` })
 
     data = await paginate(
       context.octokit.graphql,
@@ -129056,7 +129060,11 @@ const sortReleases = (releases) => {
   }
 }
 
-const findReleases = async ({ ref, context, config }) => {
+const findReleases = async ({
+  context,
+  targetCommitish,
+  filterByCommitish,
+}) => {
   let releases = await context.octokit.paginate(
     context.octokit.repos.listReleases.endpoint.merge(
       context.repo({
@@ -129067,9 +129075,8 @@ const findReleases = async ({ ref, context, config }) => {
 
   log({ context, message: `Found ${releases.length} releases` })
 
-  const { 'filter-by-commitish': filterByCommitish } = config
   const filteredReleases = filterByCommitish
-    ? releases.filter((r) => ref.match(`/${r.target_commitish}$`))
+    ? releases.filter((r) => targetCommitish.match(`/${r.target_commitish}$`))
     : releases
   const sortedPublishedReleases = sortReleases(
     filteredReleases.filter((r) => !r.draft)
@@ -129308,7 +129315,7 @@ const generateReleaseInfo = ({
   name,
   isPreRelease,
   shouldDraft,
-  commitish,
+  targetCommitish,
 }) => {
   const { owner, repo } = context.repo()
 
@@ -129358,15 +129365,23 @@ const generateReleaseInfo = ({
     name = template(name, versionInfo)
   }
 
-  if (commitish === undefined) {
-    commitish = config['commitish'] || ''
+  // Tags are not supported as `target_commitish` by Github API.
+  // GITHUB_REF or the ref from webhook start with `refs/tags/`, so we handle
+  // those here. If it doesn't but is still a tag - it must have been set
+  // explicitly by the user, so it's fair to just let the API respond with an error.
+  if (targetCommitish.startsWith('refs/tags/')) {
+    log({
+      context,
+      message: `${targetCommitish} is not supported as release target, falling back to default branch`,
+    })
+    targetCommitish = ''
   }
 
   return {
     name,
     tag,
     body,
-    commitish,
+    targetCommitish,
     prerelease: isPreRelease,
     draft: shouldDraft,
   }
@@ -129375,7 +129390,7 @@ const generateReleaseInfo = ({
 const createRelease = ({ context, releaseInfo }) => {
   return context.octokit.repos.createRelease(
     context.repo({
-      target_commitish: releaseInfo.commitish,
+      target_commitish: releaseInfo.targetCommitish,
       name: releaseInfo.name,
       tag_name: releaseInfo.tag,
       body: releaseInfo.body,
@@ -129389,7 +129404,7 @@ const updateRelease = ({ context, draftRelease, releaseInfo }) => {
   const updateReleaseParameters = updateDraftReleaseParameters({
     name: releaseInfo.name || draftRelease.name,
     tag_name: releaseInfo.tag || draftRelease.tag_name,
-    target_commitish: releaseInfo.commitish,
+    target_commitish: releaseInfo.targetCommitish,
   })
 
   return context.octokit.repos.updateRelease(
diff --git a/docker-compose.yml b/docker-compose.yml
index a099147..01b7bb9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -7,5 +7,5 @@ services:
       context: .
       args:
         NODE_ENV: development
-    command: ['npm', 'test']
+    command: ['yarn', 'test']
     entrypoint: ''
diff --git a/index.js b/index.js
index 5740e89..a4babd9 100644
--- a/index.js
+++ b/index.js
@@ -158,15 +158,19 @@ module.exports = (app, { getRouter }) => {
       return
     }
 
+    const targetCommitish = commitish || config['commitish'] || ref
+    const filterByCommitish = config['filter-by-commitish']
+
     const { draftRelease, lastRelease } = await findReleases({
-      ref,
       context,
-      config,
+      targetCommitish,
+      filterByCommitish,
     })
+
     const { commits, pullRequests: mergedPullRequests } =
       await findCommitsWithAssociatedPullRequests({
         context,
-        ref,
+        targetCommitish,
         lastRelease,
         config,
       })
@@ -188,7 +192,7 @@ module.exports = (app, { getRouter }) => {
       name,
       isPreRelease,
       shouldDraft,
-      commitish,
+      targetCommitish,
     })
 
     let createOrUpdateReleaseResponse
diff --git a/lib/commits.js b/lib/commits.js
index 37d1711..b42fc30 100644
--- a/lib/commits.js
+++ b/lib/commits.js
@@ -6,7 +6,7 @@ const findCommitsWithAssociatedPullRequestsQuery = /* GraphQL */ `
   query findCommitsWithAssociatedPullRequests(
     $name: String!
     $owner: String!
-    $ref: String!
+    $targetCommitish: String!
     $withPullRequestBody: Boolean!
     $withPullRequestURL: Boolean!
     $since: GitTimestamp
@@ -15,7 +15,7 @@ const findCommitsWithAssociatedPullRequestsQuery = /* GraphQL */ `
     $withHeadRefName: Boolean!
   ) {
     repository(name: $name, owner: $owner) {
-      object(expression: $ref) {
+      object(expression: $targetCommitish) {
         ... on Commit {
           history(first: 100, since: $since, after: $after) {
             totalCount
@@ -67,7 +67,7 @@ const findCommitsWithAssociatedPullRequestsQuery = /* GraphQL */ `
 
 const findCommitsWithAssociatedPullRequests = async ({
   context,
-  ref,
+  targetCommitish,
   lastRelease,
   config,
 }) => {
@@ -75,7 +75,7 @@ const findCommitsWithAssociatedPullRequests = async ({
   const variables = {
     name: repo,
     owner,
-    ref,
+    targetCommitish,
     withPullRequestBody: config['change-template'].includes('$BODY'),
     withPullRequestURL: config['change-template'].includes('$URL'),
     withBaseRefName: config['change-template'].includes('$BASE_REF_NAME'),
@@ -88,7 +88,7 @@ const findCommitsWithAssociatedPullRequests = async ({
   if (lastRelease) {
     log({
       context,
-      message: `Fetching all commits for reference ${ref} since ${lastRelease.created_at}`,
+      message: `Fetching parent commits of ${targetCommitish} since ${lastRelease.created_at}`,
     })
 
     data = await paginate(
@@ -103,7 +103,7 @@ const findCommitsWithAssociatedPullRequests = async ({
       (commit) => commit.committedDate != lastRelease.created_at
     )
   } else {
-    log({ context, message: `Fetching all commits for reference ${ref}` })
+    log({ context, message: `Fetching parent commits of ${targetCommitish}` })
 
     data = await paginate(
       context.octokit.graphql,
diff --git a/lib/releases.js b/lib/releases.js
index 950e811..4e501db 100644
--- a/lib/releases.js
+++ b/lib/releases.js
@@ -17,7 +17,11 @@ const sortReleases = (releases) => {
   }
 }
 
-const findReleases = async ({ ref, context, config }) => {
+const findReleases = async ({
+  context,
+  targetCommitish,
+  filterByCommitish,
+}) => {
   let releases = await context.octokit.paginate(
     context.octokit.repos.listReleases.endpoint.merge(
       context.repo({
@@ -28,9 +32,8 @@ const findReleases = async ({ ref, context, config }) => {
 
   log({ context, message: `Found ${releases.length} releases` })
 
-  const { 'filter-by-commitish': filterByCommitish } = config
   const filteredReleases = filterByCommitish
-    ? releases.filter((r) => ref.match(`/${r.target_commitish}$`))
+    ? releases.filter((r) => targetCommitish.match(`/${r.target_commitish}$`))
     : releases
   const sortedPublishedReleases = sortReleases(
     filteredReleases.filter((r) => !r.draft)
@@ -269,7 +272,7 @@ const generateReleaseInfo = ({
   name,
   isPreRelease,
   shouldDraft,
-  commitish,
+  targetCommitish,
 }) => {
   const { owner, repo } = context.repo()
 
@@ -319,15 +322,23 @@ const generateReleaseInfo = ({
     name = template(name, versionInfo)
   }
 
-  if (commitish === undefined) {
-    commitish = config['commitish'] || ''
+  // Tags are not supported as `target_commitish` by Github API.
+  // GITHUB_REF or the ref from webhook start with `refs/tags/`, so we handle
+  // those here. If it doesn't but is still a tag - it must have been set
+  // explicitly by the user, so it's fair to just let the API respond with an error.
+  if (targetCommitish.startsWith('refs/tags/')) {
+    log({
+      context,
+      message: `${targetCommitish} is not supported as release target, falling back to default branch`,
+    })
+    targetCommitish = ''
   }
 
   return {
     name,
     tag,
     body,
-    commitish,
+    targetCommitish,
     prerelease: isPreRelease,
     draft: shouldDraft,
   }
@@ -336,7 +347,7 @@ const generateReleaseInfo = ({
 const createRelease = ({ context, releaseInfo }) => {
   return context.octokit.repos.createRelease(
     context.repo({
-      target_commitish: releaseInfo.commitish,
+      target_commitish: releaseInfo.targetCommitish,
       name: releaseInfo.name,
       tag_name: releaseInfo.tag,
       body: releaseInfo.body,
@@ -350,7 +361,7 @@ const updateRelease = ({ context, draftRelease, releaseInfo }) => {
   const updateReleaseParameters = updateDraftReleaseParameters({
     name: releaseInfo.name || draftRelease.name,
     tag_name: releaseInfo.tag || draftRelease.tag_name,
-    target_commitish: releaseInfo.commitish,
+    target_commitish: releaseInfo.targetCommitish,
   })
 
   return context.octokit.repos.updateRelease(
diff --git a/package.json b/package.json
index af3ca4b..0c1a81a 100644
--- a/package.json
+++ b/package.json
@@ -8,14 +8,13 @@
   "repository": "https://github.com/release-drafter/release-drafter",
   "scripts": {
     "build": "ncc build action.js --target es2021",
-    "dev": "nodemon --exec \"npm start\"",
     "start": "probot run ./index.js",
     "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
     "test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch --notify --notifyMode=change --coverage",
     "generate-schema": "node ./bin/generate-schema.js print",
     "generate-fixtures": "node ./bin/generate-fixtures.js",
     "lint": "eslint bin/*.js lib/*.js action.js index.js test/**/*.js",
-    "prettier": "prettier --write **/*.{js,md,json,yml,yaml}",
+    "prettier": "prettier --write **/*.{js,md,json,yml}",
     "postversion": "npm run test && git push && git push --tags",
     "open-releases": "open \"$(node -e 'console.log(`${require(\"./package.json\").repository}/releases`)')\"",
     "deploy": "git push -f heroku \"$(node -e 'console.log(`v${require(\"./package.json\").version}`)')\":master",


Test patch:
diff --git a/test/index.test.js b/test/index.test.js
index 569708e..4a43c32 100644
--- a/test/index.test.js
+++ b/test/index.test.js
@@ -134,7 +134,7 @@ describe('release-drafter', () => {
       })
 
       describe('when configured for that branch', () => {
-        it('creates a release draft', async () => {
+        it('creates a release draft targeting that branch', async () => {
           getConfigMock('config-non-master-branch.yml')
 
           nock('https://api.github.com')
@@ -160,7 +160,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/some-branch",
                   }
                 `)
                 return true
@@ -278,7 +278,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -331,7 +331,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -384,7 +384,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -428,7 +428,7 @@ describe('release-drafter', () => {
                   "name": "v2.0.1 (Code name: Placeholder)",
                   "prerelease": false,
                   "tag_name": "v2.0.1",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -475,7 +475,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -523,7 +523,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -571,7 +571,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -615,7 +615,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -657,7 +657,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -701,7 +701,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -752,7 +752,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -794,7 +794,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -845,6 +845,7 @@ describe('release-drafter', () => {
                   "name": "v3.0.0-beta",
                   "prerelease": false,
                   "tag_name": "v3.0.0-beta",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -902,7 +903,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -958,7 +959,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1014,7 +1015,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1068,7 +1069,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1122,7 +1123,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1180,7 +1181,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1235,7 +1236,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1284,7 +1285,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1327,7 +1328,7 @@ describe('release-drafter', () => {
                   "name": "v2.0.1 (Code name: Placeholder)",
                   "prerelease": false,
                   "tag_name": "v2.0.1",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1368,7 +1369,7 @@ describe('release-drafter', () => {
                   "name": "v2.1 (Code name: Placeholder)",
                   "prerelease": false,
                   "tag_name": "v2.1",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1409,7 +1410,7 @@ describe('release-drafter', () => {
                   "name": "v3 (Code name: Placeholder)",
                   "prerelease": false,
                   "tag_name": "v3",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1454,7 +1455,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1496,7 +1497,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1539,7 +1540,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1581,7 +1582,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1633,7 +1634,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -1686,7 +1687,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -1739,7 +1740,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -1789,7 +1790,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -1841,7 +1842,7 @@ describe('release-drafter', () => {
                     "name": "",
                     "prerelease": false,
                     "tag_name": "",
-                    "target_commitish": "",
+                    "target_commitish": "refs/heads/master",
                   }
                 `)
                 return true
@@ -1908,7 +1909,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -1961,7 +1962,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2030,7 +2031,7 @@ describe('release-drafter', () => {
                 "name": "",
                 "prerelease": false,
                 "tag_name": "",
-                "target_commitish": "",
+                "target_commitish": "refs/heads/master",
               }
             `)
             return true
@@ -2098,7 +2099,7 @@ describe('release-drafter', () => {
                 "name": "",
                 "prerelease": false,
                 "tag_name": "",
-                "target_commitish": "",
+                "target_commitish": "refs/heads/master",
               }
             `)
             return true
@@ -2196,7 +2197,7 @@ describe('release-drafter', () => {
                 "name": "",
                 "prerelease": false,
                 "tag_name": "",
-                "target_commitish": "",
+                "target_commitish": "refs/heads/master",
               }
             `)
             return true
@@ -2543,7 +2544,7 @@ describe('release-drafter', () => {
                   "name": "v1.0.2 🌈",
                   "prerelease": false,
                   "tag_name": "v1.0.2",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2599,7 +2600,7 @@ describe('release-drafter', () => {
                   "name": "v1.0.2 🌈",
                   "prerelease": false,
                   "tag_name": "v1.0.2",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2653,7 +2654,7 @@ describe('release-drafter', () => {
                   "name": "",
                   "prerelease": false,
                   "tag_name": "",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2705,7 +2706,7 @@ describe('release-drafter', () => {
                   "name": "v2.0.1 🌈",
                   "prerelease": false,
                   "tag_name": "v2.0.1",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2749,7 +2750,7 @@ describe('release-drafter', () => {
                   "name": "v2.1.0",
                   "prerelease": false,
                   "tag_name": "v2.1.0",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2790,7 +2791,7 @@ describe('release-drafter', () => {
                   "name": "v2.0.1",
                   "prerelease": false,
                   "tag_name": "v2.0.1",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2831,7 +2832,7 @@ describe('release-drafter', () => {
                   "name": "v2.1.0",
                   "prerelease": false,
                   "tag_name": "v2.1.0",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2872,7 +2873,7 @@ describe('release-drafter', () => {
                   "name": "v3.0.0",
                   "prerelease": false,
                   "tag_name": "v3.0.0",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true
@@ -2914,7 +2915,7 @@ describe('release-drafter', () => {
                   "name": "v3.0.0",
                   "prerelease": false,
                   "tag_name": "v3.0.0",
-                  "target_commitish": "",
+                  "target_commitish": "refs/heads/master",
                 }
               `)
               return true