-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add support for make_latest
option when creating or updating a release
#283
Conversation
Thanks for running the CI for this branch @ncipollo 🙂 I updated my contribution based on the CI logs:
|
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.
Thanks for the PR!!🎉
I had the following change requests:
- I think we probably want to make this input a string to match the API.
- I think we want to default the input to
legacy
so the default behavior is unchanged for folks. - Had a minor nitpick about method argument ordering.
src/Releases.ts
Outdated
@@ -88,7 +91,8 @@ export class GithubReleases implements Releases { | |||
prerelease: prerelease, | |||
repo: this.inputs.repo, | |||
target_commitish: commitHash, | |||
tag_name: tag | |||
tag_name: tag, | |||
make_latest: makeLatest |
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.
Hmm should this be a string? The documentation indicates this should be a string with 3 values: true
, false
& legacy
.
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.
I think that makes sense but it looks like make_latest
is not yet included in the package that provides these types (which I believe is @octokit/plugin-rest-endpoint-methods
?). I tried re-installing @actions/github
locally, but I still didn't get type hints for this field (currently used is v5.13.0, after re-install I got v5.16.2, but latest is v6.7.0)...
src/Inputs.ts
Outdated
@@ -136,6 +137,14 @@ export class CoreInputs implements Inputs { | |||
return generate == 'true' | |||
} | |||
|
|||
get makeLatest(): boolean { |
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.
I think this should be a string input so we can select true, false or legacy.
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.
I updates this to return undefined
if the input isn't provided. Not sure if that's what you want or if it instead should return "legacy"
🤔
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.
Hmm, not sure - my guess would be undefined == legacy, so either would probably be sufficient. I can test with my playground repo and we can always change the default if it's wrong after.
Closes #268
Add a new input named
makeLatest
(chosen based on the official docs) to configure whether the created or updated release should be marked as "Latest" or not.From the
make_latest
documentation:I'm unsure about the behavior for updating a release: in particular if the default for
makeLatest
istrue
, updating a release might unexpectedly make that release the latest release?I'm also unsure whether or not this action's documentation should include a note that "Drafts and prereleases cannot be set as latest." It seems self-evident to me so I didn't include it.