Fixes #26 Update dependencies and fix octokit types
Fixes #27 Add inputs for specifying owner and repo
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GithubReleases = void 0;
|
||||
class GithubReleases {
|
||||
constructor(context, git) {
|
||||
this.context = context;
|
||||
constructor(inputs, git) {
|
||||
this.inputs = inputs;
|
||||
this.git = git;
|
||||
}
|
||||
async create(tag, body, commitHash, draft, name, prerelease) {
|
||||
@@ -12,9 +12,9 @@ class GithubReleases {
|
||||
body: body,
|
||||
name: name,
|
||||
draft: draft,
|
||||
owner: this.context.repo.owner,
|
||||
owner: this.inputs.owner,
|
||||
prerelease: prerelease,
|
||||
repo: this.context.repo.repo,
|
||||
repo: this.inputs.repo,
|
||||
target_commitish: commitHash,
|
||||
tag_name: tag
|
||||
});
|
||||
@@ -22,30 +22,30 @@ class GithubReleases {
|
||||
async deleteArtifact(assetId) {
|
||||
return this.git.repos.deleteReleaseAsset({
|
||||
asset_id: assetId,
|
||||
owner: this.context.repo.owner,
|
||||
repo: this.context.repo.repo
|
||||
});
|
||||
}
|
||||
async listArtifactsForRelease(releaseId) {
|
||||
return this.git.repos.listReleaseAssets({
|
||||
owner: this.context.repo.owner,
|
||||
release_id: releaseId,
|
||||
repo: this.context.repo.repo
|
||||
});
|
||||
}
|
||||
async listReleases() {
|
||||
return this.git.repos.listReleases({
|
||||
owner: this.context.repo.owner,
|
||||
repo: this.context.repo.repo
|
||||
owner: this.inputs.owner,
|
||||
repo: this.inputs.repo
|
||||
});
|
||||
}
|
||||
async getByTag(tag) {
|
||||
return this.git.repos.getReleaseByTag({
|
||||
owner: this.context.repo.owner,
|
||||
repo: this.context.repo.repo,
|
||||
owner: this.inputs.owner,
|
||||
repo: this.inputs.repo,
|
||||
tag: tag
|
||||
});
|
||||
}
|
||||
async listArtifactsForRelease(releaseId) {
|
||||
return this.git.repos.listReleaseAssets({
|
||||
owner: this.inputs.owner,
|
||||
release_id: releaseId,
|
||||
repo: this.inputs.repo
|
||||
});
|
||||
}
|
||||
async listReleases() {
|
||||
return this.git.repos.listReleases({
|
||||
owner: this.inputs.owner,
|
||||
repo: this.inputs.repo
|
||||
});
|
||||
}
|
||||
async update(id, tag, body, commitHash, draft, name, prerelease) {
|
||||
// noinspection TypeScriptValidateJSTypes
|
||||
return this.git.repos.updateRelease({
|
||||
@@ -53,9 +53,9 @@ class GithubReleases {
|
||||
body: body,
|
||||
name: name,
|
||||
draft: draft,
|
||||
owner: this.context.repo.owner,
|
||||
owner: this.inputs.owner,
|
||||
prerelease: prerelease,
|
||||
repo: this.context.repo.repo,
|
||||
repo: this.inputs.repo,
|
||||
target_commitish: commitHash,
|
||||
tag_name: tag
|
||||
});
|
||||
@@ -69,9 +69,9 @@ class GithubReleases {
|
||||
},
|
||||
data: file,
|
||||
name: name,
|
||||
owner: this.context.repo.owner,
|
||||
owner: this.inputs.owner,
|
||||
release_id: releaseId,
|
||||
repo: this.context.repo.repo
|
||||
repo: this.inputs.repo
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user