Add option to ignore prerelease on update (#96)

This commit is contained in:
Jashandeep Sohi
2021-08-01 12:41:55 -07:00
committed by GitHub
parent dee715a153
commit 7461bfe839
9 changed files with 74 additions and 25 deletions

View File

@@ -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
)
}
}

View File

@@ -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'