diff --git a/dist/index.js b/dist/index.js index eed174c96..2fc32bb5c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -129086,8 +129086,14 @@ const findReleases = async ({ log({ context, message: `Found ${releases.length} releases` }) + // `refs/heads/branch` and `branch` are the same thing in this context + const headRefRegex = /^refs\/heads\// + const targetCommitishName = targetCommitish.replace(headRefRegex, '') const filteredReleases = filterByCommitish - ? releases.filter((r) => targetCommitish.match(`/${r.target_commitish}$`)) + ? releases.filter( + (r) => + targetCommitishName === r.target_commitish.replace(headRefRegex, '') + ) : releases const sortedPublishedReleases = sortReleases( filteredReleases.filter((r) => !r.draft) diff --git a/lib/releases.js b/lib/releases.js index 009c2747d..2881311cc 100644 --- a/lib/releases.js +++ b/lib/releases.js @@ -43,8 +43,14 @@ const findReleases = async ({ log({ context, message: `Found ${releases.length} releases` }) + // `refs/heads/branch` and `branch` are the same thing in this context + const headRefRegex = /^refs\/heads\// + const targetCommitishName = targetCommitish.replace(headRefRegex, '') const filteredReleases = filterByCommitish - ? releases.filter((r) => targetCommitish.match(`/${r.target_commitish}$`)) + ? releases.filter( + (r) => + targetCommitishName === r.target_commitish.replace(headRefRegex, '') + ) : releases const sortedPublishedReleases = sortReleases( filteredReleases.filter((r) => !r.draft)