Skip to content

Commit

Permalink
fix #197 - do not overwrite, if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed May 31, 2023
1 parent a500241 commit 1662cfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ function get_release_by_tag(tag, prerelease, make_latest, release_name, body, oc
updateObject.prerelease = false;
}
if (overwrite) {
if (release.data.name !== release_name) {
if (release_name && release.data.name !== release_name) {
core.debug(`The ${tag} release already exists with a different name ${release.data.name} so we'll overwrite it.`);
updateObject = updateObject || {};
updateObject.name = release_name;
}
if (release.data.body !== body) {
if (body && release.data.body !== body) {
core.debug(`The ${tag} release already exists with a different body ${release.data.body} so we'll overwrite it.`);
updateObject = updateObject || {};
updateObject.body = body;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ async function get_release_by_tag(
updateObject.prerelease = false
}
if (overwrite) {
if (release.data.name !== release_name) {
if (release_name && release.data.name !== release_name) {
core.debug(
`The ${tag} release already exists with a different name ${release.data.name} so we'll overwrite it.`
)
updateObject = updateObject || {}
updateObject.name = release_name
}
if (release.data.body !== body) {
if (body && release.data.body !== body) {
core.debug(
`The ${tag} release already exists with a different body ${release.data.body} so we'll overwrite it.`
)
Expand Down

0 comments on commit 1662cfa

Please sign in to comment.