mirror of
https://github.com/ncipollo/release-action
synced 2026-09-14 20:13:22 +00:00
Update "makeLatest" so it's always defined
This commit is contained in:
@@ -14,7 +14,7 @@ This action will create a GitHub release and optionally upload an artifact to it
|
|||||||
|
|
||||||
## Action Inputs
|
## Action Inputs
|
||||||
| Input name | Description | Required | Default Value |
|
| Input name | Description | Required | Default Value |
|
||||||
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|----------------------|
|
|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|----------------------|
|
||||||
| allowUpdates | An optional flag which indicates if we should update a release if it already exists. Defaults to false. | false | "" |
|
| allowUpdates | An optional flag which indicates if we should update a release if it already exists. Defaults to false. | false | "" |
|
||||||
| artifactErrorsFailBuild | An optional flag which indicates if artifact read or upload errors should fail the build. | false | "" |
|
| artifactErrorsFailBuild | An optional flag which indicates if artifact read or upload errors should fail the build. | false | "" |
|
||||||
| artifacts | An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs) | false | "" |
|
| artifacts | An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs) | false | "" |
|
||||||
@@ -25,7 +25,7 @@ This action will create a GitHub release and optionally upload an artifact to it
|
|||||||
| discussionCategory | When provided this will generate a discussion of the specified category. The category must exist otherwise this will cause the action to fail. This isn't used with draft releases | false | "" |
|
| discussionCategory | When provided this will generate a discussion of the specified category. The category must exist otherwise this will cause the action to fail. This isn't used with draft releases | false | "" |
|
||||||
| draft | Optionally marks this release as a draft release. Set to true to enable. | false | "" |
|
| draft | Optionally marks this release as a draft release. Set to true to enable. | false | "" |
|
||||||
| generateReleaseNotes | Indicates if release notes should be automatically generated. | false | false |
|
| generateReleaseNotes | Indicates if release notes should be automatically generated. | false | false |
|
||||||
| makeLatest | Indicates if the release should be the "latest" release or not. release. | false | "legacy" |
|
| makeLatest | Indicates if the release should be the "latest" release or not. | false | "legacy" |
|
||||||
| name | An optional name for the release. If this is omitted the tag will be used. | false | "" |
|
| name | An optional name for the release. If this is omitted the tag will be used. | false | "" |
|
||||||
| omitBody | Indicates if the release body should be omitted. | false | false |
|
| omitBody | Indicates if the release body should be omitted. | false | false |
|
||||||
| omitBodyDuringUpdate | Indicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates. | false | false |
|
| omitBodyDuringUpdate | Indicates if the release body should be omitted during updates. The body will still be applied for newly created releases. This will preserve the existing body during updates. | false | false |
|
||||||
|
|||||||
@@ -240,11 +240,6 @@ describe('Inputs', () => {
|
|||||||
mockGetInput.mockReturnValueOnce('true')
|
mockGetInput.mockReturnValueOnce('true')
|
||||||
expect(inputs.makeLatest).toBe('true')
|
expect(inputs.makeLatest).toBe('true')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns undefined when omitted', () => {
|
|
||||||
mockGetInput.mockReturnValueOnce('')
|
|
||||||
expect(inputs.makeLatest).toBeUndefined()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('owner', () => {
|
describe('owner', () => {
|
||||||
|
|||||||
Vendored
+1
-5
@@ -780,11 +780,7 @@ class CoreInputs {
|
|||||||
return generate == 'true';
|
return generate == 'true';
|
||||||
}
|
}
|
||||||
get makeLatest() {
|
get makeLatest() {
|
||||||
const makeLatest = core.getInput('makeLatest');
|
return core.getInput('makeLatest');
|
||||||
if (makeLatest) {
|
|
||||||
return makeLatest;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
get owner() {
|
get owner() {
|
||||||
let owner = core.getInput('owner');
|
let owner = core.getInput('owner');
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-5
@@ -115,11 +115,7 @@ class CoreInputs {
|
|||||||
return generate == 'true';
|
return generate == 'true';
|
||||||
}
|
}
|
||||||
get makeLatest() {
|
get makeLatest() {
|
||||||
const makeLatest = core.getInput('makeLatest');
|
return core.getInput('makeLatest');
|
||||||
if (makeLatest) {
|
|
||||||
return makeLatest;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
get owner() {
|
get owner() {
|
||||||
let owner = core.getInput('owner');
|
let owner = core.getInput('owner');
|
||||||
|
|||||||
+2
-7
@@ -137,13 +137,8 @@ export class CoreInputs implements Inputs {
|
|||||||
return generate == 'true'
|
return generate == 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
get makeLatest(): string | undefined {
|
get makeLatest(): string {
|
||||||
const makeLatest = core.getInput('makeLatest')
|
return core.getInput('makeLatest')
|
||||||
if (makeLatest) {
|
|
||||||
return makeLatest
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get owner(): string {
|
get owner(): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user