Add make_latest option (#283)

This commit is contained in:
Eric Cornelissen
2022-12-11 19:45:00 +01:00
committed by GitHub
parent 3dd806f2bf
commit 0bf6967166
10 changed files with 70 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ class Action {
}
updateRelease(id) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.releases.update(id, this.inputs.tag, this.inputs.updatedReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.updatedDraft, this.inputs.updatedReleaseName, this.inputs.updatedPrerelease);
return yield this.releases.update(id, this.inputs.tag, this.inputs.updatedReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.updatedDraft, this.inputs.makeLatest, this.inputs.updatedReleaseName, this.inputs.updatedPrerelease);
});
}
static noPublishedRelease(error) {
@@ -126,7 +126,7 @@ class Action {
}
createRelease() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.releases.create(this.inputs.tag, this.inputs.createdReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.createdDraft, this.inputs.generateReleaseNotes, this.inputs.createdReleaseName, this.inputs.createdPrerelease);
return yield this.releases.create(this.inputs.tag, this.inputs.createdReleaseBody, this.inputs.commit, this.inputs.discussionCategory, this.inputs.createdDraft, this.inputs.generateReleaseNotes, this.inputs.makeLatest, this.inputs.createdReleaseName, this.inputs.createdPrerelease);
});
}
}

View File

@@ -114,6 +114,13 @@ class CoreInputs {
const generate = core.getInput('generateReleaseNotes');
return generate == 'true';
}
get makeLatest() {
const makeLatest = core.getInput('makeLatest');
if (makeLatest) {
return makeLatest;
}
return undefined;
}
get owner() {
let owner = core.getInput('owner');
if (owner) {

View File

@@ -15,7 +15,7 @@ class GithubReleases {
this.inputs = inputs;
this.git = git;
}
create(tag, body, commitHash, discussionCategory, draft, generateReleaseNotes, name, prerelease) {
create(tag, body, commitHash, discussionCategory, draft, generateReleaseNotes, makeLatest, name, prerelease) {
return __awaiter(this, void 0, void 0, function* () {
// noinspection TypeScriptValidateJSTypes
return this.git.rest.repos.createRelease({
@@ -24,6 +24,7 @@ class GithubReleases {
discussion_category_name: discussionCategory,
draft: draft,
generate_release_notes: generateReleaseNotes,
make_latest: makeLatest,
owner: this.inputs.owner,
prerelease: prerelease,
repo: this.inputs.repo,
@@ -67,7 +68,7 @@ class GithubReleases {
});
});
}
update(id, tag, body, commitHash, discussionCategory, draft, name, prerelease) {
update(id, tag, body, commitHash, discussionCategory, draft, makeLatest, name, prerelease) {
return __awaiter(this, void 0, void 0, function* () {
// noinspection TypeScriptValidateJSTypes
return this.git.rest.repos.updateRelease({
@@ -76,6 +77,7 @@ class GithubReleases {
name: name,
discussion_category_name: discussionCategory,
draft: draft,
make_latest: makeLatest,
owner: this.inputs.owner,
prerelease: prerelease,
repo: this.inputs.repo,