Add option to ignore prerelease on update (#96)
This commit is contained in:
@@ -69,7 +69,7 @@ export class Action {
|
||||
this.inputs.discussionCategory,
|
||||
this.inputs.draft,
|
||||
this.inputs.updatedReleaseName,
|
||||
this.inputs.prerelease
|
||||
this.inputs.updatedPrerelease
|
||||
)
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ export class Action {
|
||||
this.inputs.discussionCategory,
|
||||
this.inputs.draft,
|
||||
this.inputs.createdReleaseName,
|
||||
this.inputs.prerelease
|
||||
this.inputs.createdPrerelease
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,14 @@ export interface Inputs {
|
||||
readonly discussionCategory?: string
|
||||
readonly draft: boolean
|
||||
readonly owner: string
|
||||
readonly prerelease: boolean
|
||||
readonly createdPrerelease: boolean
|
||||
readonly replacesArtifacts: boolean
|
||||
readonly repo: string
|
||||
readonly tag: string
|
||||
readonly token: string
|
||||
readonly updatedReleaseBody?: string
|
||||
readonly updatedReleaseName?: string
|
||||
readonly updatedPrerelease?: boolean
|
||||
}
|
||||
|
||||
export class CoreInputs implements Inputs {
|
||||
@@ -124,11 +125,19 @@ export class CoreInputs implements Inputs {
|
||||
return this.context.repo.owner
|
||||
}
|
||||
|
||||
get prerelease(): boolean {
|
||||
get createdPrerelease(): boolean {
|
||||
const preRelease = core.getInput('prerelease')
|
||||
return preRelease == 'true'
|
||||
}
|
||||
|
||||
private static get omitPrereleaseDuringUpdate(): boolean {
|
||||
return core.getInput('omitPrereleaseDuringUpdate') == 'true'
|
||||
}
|
||||
|
||||
get updatedPrerelease(): boolean | undefined {
|
||||
if (CoreInputs.omitPrereleaseDuringUpdate) return undefined
|
||||
return this.createdPrerelease
|
||||
}
|
||||
get replacesArtifacts(): boolean {
|
||||
const replaces = core.getInput('replacesArtifacts')
|
||||
return replaces == 'true'
|
||||
|
||||
Reference in New Issue
Block a user