Repository: release-drafter/release-drafter
Pull request #1421 (2025-01-09 14:30:17)

Update README.md
The sentence seems to be incorrect. 


Patch:
diff --git a/README.md b/README.md
index 189d7c0..db55647 100644
--- a/README.md
+++ b/README.md
@@ -285,7 +285,7 @@ Pull requests with the label "skip-changelog" will now be excluded from the rele
 
 ## Include Pull Requests
 
-With the `include-labels` option you can specify pull requests from the release notes using labels. Only pull requests that have the configured labels will be included in the pull request. For example, append the following to your `.github/release-drafter.yml` file:
+With the `include-labels` option you can specify pull requests from the release notes using labels. Only pull requests that have the configured labels will be included in the release draft. For example, append the following to your `.github/release-drafter.yml` file:
 
 ```yml
 include-labels:
diff --git a/dist/index.js b/dist/index.js
index 96194ee..d1afe60 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -142984,7 +142984,9 @@ const findReleases = async ({
     ),
     tagPrefix
   )
-  const draftRelease = filteredReleases.find((r) => r.draft)
+  const draftRelease = filteredReleases.find(
+    (r) => r.draft && r.prerelease === includePreReleases
+  )
   const lastRelease = sortedSelectedReleases[sortedSelectedReleases.length - 1]
 
   if (draftRelease) {
diff --git a/lib/releases.js b/lib/releases.js
index 1f22d6e..fd89428 100644
--- a/lib/releases.js
+++ b/lib/releases.js
@@ -68,7 +68,9 @@ const findReleases = async ({
     ),
     tagPrefix
   )
-  const draftRelease = filteredReleases.find((r) => r.draft)
+  const draftRelease = filteredReleases.find(
+    (r) => r.draft && r.prerelease === includePreReleases
+  )
   const lastRelease = sortedSelectedReleases[sortedSelectedReleases.length - 1]
 
   if (draftRelease) {


Test patch:
diff --git a/test/releases.test.js b/test/releases.test.js
index 67b329f..cbefadd 100644
--- a/test/releases.test.js
+++ b/test/releases.test.js
@@ -318,6 +318,7 @@ describe('releases', () => {
       const { draftRelease } = await findReleases({
         context,
         targetCommitish: 'refs/heads/master',
+        includePreReleases: false,
         tagPrefix: '',
       })
 
@@ -332,21 +333,27 @@ describe('releases', () => {
       paginateMock.mockResolvedValueOnce([
         { tag_name: 'v1.0.0', draft: true, prerelease: false },
         { tag_name: 'v1.0.1', draft: false, prerelease: false },
-        { tag_name: 'v1.0.2-rc.1', draft: false, prerelease: true },
+        { tag_name: 'v1.0.2-rc.1', draft: true, prerelease: true },
       ])
 
-      const { lastRelease } = await findReleases({
+      const { draftRelease, lastRelease } = await findReleases({
         context,
         targetCommitish: 'refs/heads/master',
         tagPrefix: '',
         includePreReleases: true,
       })
 
-      expect(lastRelease).toEqual({
+      expect(draftRelease).toEqual({
         tag_name: 'v1.0.2-rc.1',
-        draft: false,
+        draft: true,
         prerelease: true,
       })
+
+      expect(lastRelease).toEqual({
+        tag_name: 'v1.0.1',
+        draft: false,
+        prerelease: false,
+      })
     })
   })
 })