Skip to content
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

fix: updating release draft status from true to false #316

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 2 additions & 4 deletions dist/index.js

Large diffs are not rendered by default.

15 changes: 4 additions & 11 deletions src/github.ts
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -206,26 +206,19 @@ export const release = async (
const discussion_category_name = config.input_discussion_category_name; const discussion_category_name = config.input_discussion_category_name;
const generate_release_notes = config.input_generate_release_notes; const generate_release_notes = config.input_generate_release_notes;
try { 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 // so we must find one in the list of all releases
let _release: Release | undefined = undefined; let _release: Release | undefined = undefined;
if (config.input_draft) {
for await (const response of releaser.allReleases({ for await (const response of releaser.allReleases({
owner, owner,
repo, repo,
})) { })) {
_release = response.data.find((release) => release.tag_name === tag); _release = response.data.find((release) => release.tag_name === tag);
if (_release !== undefined) {
break;
} }
} else {
_release = (
await releaser.getReleaseByTag({
owner,
repo,
tag,
})
).data;
} }
if (_release === null || _release === undefined) { if (_release === undefined) {
return await createRelease( return await createRelease(
tag, tag,
config, config,
Expand Down