-
Notifications
You must be signed in to change notification settings - Fork 84
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
Skip updating an existing issue when update_existing=false. #112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @dblock, thanks so much for adding the tests and README updates. I left one minor comment about a tiny bit of code clarity, but otherwise this is good to go.
let updateExisting: Boolean | null = null | ||
if (tools.inputs.update_existing) { | ||
if (tools.inputs.update_existing === 'true') { | ||
updateExisting = true | ||
} else if (tools.inputs.update_existing === 'false') { | ||
updateExisting = false | ||
} else { | ||
tools.exit.failure(`Invalid value update_existing=${tools.inputs.update_existing}, must be one of true or false`) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for adding the validation check (and the test) 🔥 ✨
aad5a8a
to
d21b730
Compare
d21b730
to
3eebcfd
Compare
Rebased, updated with the suggested change, and ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo! Thanks for doing this 🎉
Published in https://github.com/JasonEtco/create-an-issue/releases/tag/v2.6.0! Thanks again for the contribution 🙌 |
As far as I can see
update_existing=garbage
orupdate_existing=false
works asupdate_existing=true
today becauseBoolean
doesn't parse but casts anything to true/false. With this changeupdate_existing
can betrue
,false
and undefined.true
, an existing issue is updated.false
, an existing issue is not updated.undefined
, a new issue is always created.Closes #108.