Skip to content

Commit

Permalink
Update draft releases too
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasPiskol committed Feb 10, 2021
1 parent 12579db commit ff30f8e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export const release = async (
const tag =
config.input_tag_name || config.github_ref.replace("refs/tags/", "");
try {
let existingRelease;

// you can't get a an existing draft by tag
// so we must find one in the list of all releases
if (config.input_draft) {
Expand All @@ -156,15 +158,18 @@ export const release = async (
})) {
let release = response.data.find(release => release.tag_name === tag);
if (release) {
return release;
existingRelease = release;
break;
}
}
}
let existingRelease = await releaser.getReleaseByTag({
owner,
repo,
tag
});
if (!existingRelease) {
existingRelease = await releaser.getReleaseByTag({
owner,
repo,
tag
});
}

const release_id = existingRelease.data.id;
let target_commitish: string;
Expand Down

0 comments on commit ff30f8e

Please sign in to comment.