Add prerelease
This commit is contained in:
@@ -48,7 +48,7 @@ class Action {
|
||||
}
|
||||
createRelease() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const response = yield this.releases.create(this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name);
|
||||
const response = yield this.releases.create(this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name, this.inputs.prerelease);
|
||||
return response.data.upload_url;
|
||||
});
|
||||
}
|
||||
@@ -58,7 +58,7 @@ class Action {
|
||||
}
|
||||
updateRelease(id) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const response = yield this.releases.update(id, this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name);
|
||||
const response = yield this.releases.update(id, this.inputs.tag, this.inputs.body, this.inputs.commit, this.inputs.draft, this.inputs.name, this.inputs.prerelease);
|
||||
return response.data.upload_url;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,6 +58,10 @@ class CoreInputs {
|
||||
}
|
||||
return this.tag;
|
||||
}
|
||||
get prerelease() {
|
||||
const draft = core.getInput('prerelease');
|
||||
return draft == 'true';
|
||||
}
|
||||
get tag() {
|
||||
const tag = core.getInput('tag');
|
||||
if (tag) {
|
||||
|
||||
@@ -14,13 +14,14 @@ class GithubReleases {
|
||||
this.context = context;
|
||||
this.git = git;
|
||||
}
|
||||
create(tag, body, commitHash, draft, name) {
|
||||
create(tag, body, commitHash, draft, name, prerelease) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this.git.repos.createRelease({
|
||||
body: body,
|
||||
name: name,
|
||||
draft: draft,
|
||||
owner: this.context.repo.owner,
|
||||
prerelease: prerelease,
|
||||
repo: this.context.repo.repo,
|
||||
target_commitish: commitHash,
|
||||
tag_name: tag
|
||||
@@ -36,7 +37,7 @@ class GithubReleases {
|
||||
});
|
||||
});
|
||||
}
|
||||
update(id, tag, body, commitHash, draft, name) {
|
||||
update(id, tag, body, commitHash, draft, name, prerelease) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return this.git.repos.updateRelease({
|
||||
release_id: id,
|
||||
@@ -44,6 +45,7 @@ class GithubReleases {
|
||||
name: name,
|
||||
draft: draft,
|
||||
owner: this.context.repo.owner,
|
||||
prerelease: prerelease,
|
||||
repo: this.context.repo.repo,
|
||||
target_commitish: commitHash,
|
||||
tag_name: tag
|
||||
|
||||
Reference in New Issue
Block a user