Skip to content

test(release): add unit tests when searching for a release #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export const release = async (
const discussion_category_name = config.input_discussion_category_name;
const generate_release_notes = config.input_generate_release_notes;
try {
// you can't get a an existing draft by tag
// you can't get an existing draft by tag
// so we must find one in the list of all releases
let _release: Release | undefined = undefined;
if (config.input_draft) {
Expand All @@ -234,6 +234,10 @@ export const release = async (
repo,
})) {
_release = response.data.find((release) => release.tag_name === tag);
// detect if we found a release - note that a draft release tag may be an empty string
if (typeof _release !== "undefined") {
break;
}
}
} else {
_release = (
Expand Down
Loading