Bump github types to 5.0.0

This commit is contained in:
Nick Cipollo
2021-06-30 16:34:09 -04:00
parent 793ce4c6b0
commit 289da33bfb
5 changed files with 87 additions and 53 deletions

View File

@@ -10,7 +10,7 @@ import {Outputs} from "../src/Outputs";
// This test is currently intended to be manually run during development. To run:
// - Make sure you have an environment variable named GITHUB_TOKEN assigned to your token
// - Remove skip from the test below
describe.skip('Integration Test', () => {
describe('Integration Test', () => {
let action: Action
beforeEach(() => {
@@ -39,7 +39,7 @@ describe.skip('Integration Test', () => {
artifactErrorsFailBuild: false,
artifacts: artifacts(),
createdReleaseBody: "This release was generated by release-action's integration test",
createdReleaseName: "Releases Action Integration Test 2",
createdReleaseName: "Releases Action Integration Test 3",
commit: "",
discussionCategory: 'Release',
draft: false,
@@ -50,7 +50,7 @@ describe.skip('Integration Test', () => {
tag: "release-action-test",
token: getToken(),
updatedReleaseBody: "This release was generated by release-action's integration test",
updatedReleaseName: "Releases Action Integration Test 2"
updatedReleaseName: "Releases Action Integration Test 3"
}
})
return new MockInputs();

View File

@@ -18,7 +18,7 @@ class GithubReleases {
create(tag, body, commitHash, discussionCategory, draft, name, prerelease) {
return __awaiter(this, void 0, void 0, function* () {
// noinspection TypeScriptValidateJSTypes
return this.git.repos.createRelease({
return this.git.rest.repos.createRelease({
body: body,
name: name,
discussion_category_name: discussionCategory,
@@ -33,7 +33,7 @@ class GithubReleases {
}
deleteArtifact(assetId) {
return __awaiter(this, void 0, void 0, function* () {
return this.git.repos.deleteReleaseAsset({
return this.git.rest.repos.deleteReleaseAsset({
asset_id: assetId,
owner: this.inputs.owner,
repo: this.inputs.repo
@@ -42,7 +42,7 @@ class GithubReleases {
}
getByTag(tag) {
return __awaiter(this, void 0, void 0, function* () {
return this.git.repos.getReleaseByTag({
return this.git.rest.repos.getReleaseByTag({
owner: this.inputs.owner,
repo: this.inputs.repo,
tag: tag
@@ -51,7 +51,7 @@ class GithubReleases {
}
listArtifactsForRelease(releaseId) {
return __awaiter(this, void 0, void 0, function* () {
return this.git.paginate(this.git.repos.listReleaseAssets, {
return this.git.paginate(this.git.rest.repos.listReleaseAssets, {
owner: this.inputs.owner,
release_id: releaseId,
repo: this.inputs.repo
@@ -60,7 +60,7 @@ class GithubReleases {
}
listReleases() {
return __awaiter(this, void 0, void 0, function* () {
return this.git.repos.listReleases({
return this.git.rest.repos.listReleases({
owner: this.inputs.owner,
repo: this.inputs.repo
});
@@ -69,7 +69,7 @@ class GithubReleases {
update(id, tag, body, commitHash, discussionCategory, draft, name, prerelease) {
return __awaiter(this, void 0, void 0, function* () {
// noinspection TypeScriptValidateJSTypes
return this.git.repos.updateRelease({
return this.git.rest.repos.updateRelease({
release_id: id,
body: body,
name: name,
@@ -85,7 +85,7 @@ class GithubReleases {
}
uploadArtifact(assetUrl, contentLength, contentType, file, name, releaseId) {
return __awaiter(this, void 0, void 0, function* () {
return this.git.repos.uploadReleaseAsset({
return this.git.rest.repos.uploadReleaseAsset({
url: assetUrl,
headers: {
"content-length": contentLength,

View File

@@ -24,7 +24,7 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.4.0",
"@actions/github": "^4.0.0",
"@actions/github": "^5.0.0",
"@types/glob": "^7.1.3",
"glob": "^7.1.7",
"untildify": "^4.0.0"

View File

@@ -76,7 +76,7 @@ export class GithubReleases implements Releases {
prerelease?: boolean
): Promise<CreateReleaseResponse> {
// noinspection TypeScriptValidateJSTypes
return this.git.repos.createRelease({
return this.git.rest.repos.createRelease({
body: body,
name: name,
discussion_category_name: discussionCategory,
@@ -92,7 +92,7 @@ export class GithubReleases implements Releases {
async deleteArtifact(
assetId: number
): Promise<OctokitResponse<any>> {
return this.git.repos.deleteReleaseAsset({
return this.git.rest.repos.deleteReleaseAsset({
asset_id: assetId,
owner: this.inputs.owner,
repo: this.inputs.repo
@@ -100,7 +100,7 @@ export class GithubReleases implements Releases {
}
async getByTag(tag: string): Promise<ReleaseByTagResponse> {
return this.git.repos.getReleaseByTag({
return this.git.rest.repos.getReleaseByTag({
owner: this.inputs.owner,
repo: this.inputs.repo,
tag: tag
@@ -110,7 +110,7 @@ export class GithubReleases implements Releases {
async listArtifactsForRelease(
releaseId: number
): Promise<ListReleaseAssetsResponseData> {
return this.git.paginate(this.git.repos.listReleaseAssets, {
return this.git.paginate(this.git.rest.repos.listReleaseAssets, {
owner: this.inputs.owner,
release_id: releaseId,
repo: this.inputs.repo
@@ -118,7 +118,7 @@ export class GithubReleases implements Releases {
}
async listReleases(): Promise<ListReleasesResponse> {
return this.git.repos.listReleases({
return this.git.rest.repos.listReleases({
owner: this.inputs.owner,
repo: this.inputs.repo
})
@@ -135,7 +135,7 @@ export class GithubReleases implements Releases {
prerelease?: boolean
): Promise<UpdateReleaseResponse> {
// noinspection TypeScriptValidateJSTypes
return this.git.repos.updateRelease({
return this.git.rest.repos.updateRelease({
release_id: id,
body: body,
name: name,
@@ -157,7 +157,7 @@ export class GithubReleases implements Releases {
name: string,
releaseId: number,
): Promise<UploadArtifactResponse> {
return this.git.repos.uploadReleaseAsset({
return this.git.rest.repos.uploadReleaseAsset({
url: assetUrl,
headers: {
"content-length": contentLength,

104
yarn.lock
View File

@@ -7,20 +7,20 @@
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.4.0.tgz#cf2e6ee317e314b03886adfeb20e448d50d6e524"
integrity sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg==
"@actions/github@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@actions/github/-/github-4.0.0.tgz#d520483151a2bf5d2dc9cd0f20f9ac3a2e458816"
integrity sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==
"@actions/github@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.0.0.tgz#1754127976c50bd88b2e905f10d204d76d1472f8"
integrity sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==
dependencies:
"@actions/http-client" "^1.0.8"
"@octokit/core" "^3.0.0"
"@octokit/plugin-paginate-rest" "^2.2.3"
"@octokit/plugin-rest-endpoint-methods" "^4.0.0"
"@actions/http-client" "^1.0.11"
"@octokit/core" "^3.4.0"
"@octokit/plugin-paginate-rest" "^2.13.3"
"@octokit/plugin-rest-endpoint-methods" "^5.1.1"
"@actions/http-client@^1.0.8":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.9.tgz#af1947d020043dbc6a3b4c5918892095c30ffb52"
integrity sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==
"@actions/http-client@^1.0.11":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0"
integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==
dependencies:
tunnel "0.0.6"
@@ -494,16 +494,17 @@
dependencies:
"@octokit/types" "^6.0.3"
"@octokit/core@^3.0.0":
version "3.2.5"
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.2.5.tgz#57becbd5fd789b0592b915840855f3a5f233d554"
integrity sha512-+DCtPykGnvXKWWQI0E1XD+CCeWSBhB6kwItXqfFmNBlIlhczuDPbg+P6BtLnVBaRJDAjv+1mrUJuRsFSjktopg==
"@octokit/core@^3.4.0":
version "3.5.1"
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b"
integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==
dependencies:
"@octokit/auth-token" "^2.4.4"
"@octokit/graphql" "^4.5.8"
"@octokit/request" "^5.4.12"
"@octokit/request" "^5.6.0"
"@octokit/request-error" "^2.0.5"
"@octokit/types" "^6.0.3"
before-after-hook "^2.1.0"
before-after-hook "^2.2.0"
universal-user-agent "^6.0.0"
"@octokit/endpoint@^6.0.1":
@@ -529,19 +530,24 @@
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-4.0.1.tgz#bafd3d173974827ba0b733fcca7f1860cb71a9aa"
integrity sha512-k2hRcfcLRyPJjtYfJLzg404n7HZ6sUpAWAR/uNI8tf96NgatWOpw1ocdF+WFfx/trO1ivBh7ckynO1rn+xAw/Q==
"@octokit/plugin-paginate-rest@^2.2.3":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.9.1.tgz#e9bb34a89b7ed5b801f1c976feeb9b0078ecd201"
integrity sha512-8wnuWGjwDIEobbBet2xAjZwgiMVTgIer5wBsnGXzV3lJ4yqphLU2FEMpkhSrDx7y+WkZDfZ+V+1cFMZ1mAaFag==
dependencies:
"@octokit/types" "^6.8.0"
"@octokit/openapi-types@^8.1.4":
version "8.1.4"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-8.1.4.tgz#20684667b50176b5d24cdb89799a8a12d38c3775"
integrity sha512-NnGr4NNDqO5wjSDJo5nxrGtzZUwoT23YasqK2H4Pav/6vSgeVTxuqCL9Aeh+cWfTxDomj1M4Os5BrXFsvl7qiQ==
"@octokit/plugin-rest-endpoint-methods@^4.0.0":
version "4.10.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.10.1.tgz#b7a9181d1f52fef70a13945c5b49cffa51862da1"
integrity sha512-YGMiEidTORzgUmYZu0eH4q2k8kgQSHQMuBOBYiKxUYs/nXea4q/Ze6tDzjcRAPmHNJYXrENs1bEMlcdGKT+8ug==
"@octokit/plugin-paginate-rest@^2.13.3":
version "2.13.6"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.6.tgz#03633839b0ec57a108d2ca1c4b1f64b749d3506c"
integrity sha512-ai7TNKLi8tGkDvLM7fm0X1fbIP9u1nfXnN49ZAw2PgSoQou9yixKn5c3m0awuLacbuX2aXEvJpv1gKm3jboabg==
dependencies:
"@octokit/types" "^6.8.2"
"@octokit/types" "^6.17.3"
"@octokit/plugin-rest-endpoint-methods@^5.1.1":
version "5.3.7"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.7.tgz#a55f9ad0a0f43256813dcb5c4a3c70dad582696a"
integrity sha512-LAgTLOsJ86ig2wYSpcSx+UWt7aQYYsEZ/Tf/pksAVQWKNcGuTVCDl9OUiPhQ7DZelNozYVWTO9Iyjd/soe4tug==
dependencies:
"@octokit/types" "^6.17.4"
deprecation "^2.3.1"
"@octokit/request-error@^2.0.0":
@@ -553,7 +559,16 @@
deprecation "^2.0.0"
once "^1.4.0"
"@octokit/request@^5.3.0", "@octokit/request@^5.4.12":
"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677"
integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==
dependencies:
"@octokit/types" "^6.0.3"
deprecation "^2.0.0"
once "^1.4.0"
"@octokit/request@^5.3.0":
version "5.4.14"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.14.tgz#ec5f96f78333bb2af390afa5ff66f114b063bc96"
integrity sha512-VkmtacOIQp9daSnBmDI92xNIeLuSRDOIuplp/CJomkvzt7M18NXgG044Cx/LFKLgjKt9T2tZR6AtJayba9GTSA==
@@ -567,7 +582,19 @@
once "^1.4.0"
universal-user-agent "^6.0.0"
"@octokit/types@^6.0.3", "@octokit/types@^6.7.1", "@octokit/types@^6.8.0", "@octokit/types@^6.8.2":
"@octokit/request@^5.6.0":
version "5.6.0"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.0.tgz#6084861b6e4fa21dc40c8e2a739ec5eff597e672"
integrity sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA==
dependencies:
"@octokit/endpoint" "^6.0.1"
"@octokit/request-error" "^2.1.0"
"@octokit/types" "^6.16.1"
is-plain-object "^5.0.0"
node-fetch "^2.6.1"
universal-user-agent "^6.0.0"
"@octokit/types@^6.0.3", "@octokit/types@^6.7.1":
version "6.8.2"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.8.2.tgz#ce4872e038d6df38b2d3c21bc12329af0b10facb"
integrity sha512-RpG0NJd7OKSkWptiFhy1xCLkThs5YoDIKM21lEtDmUvSpbaIEfrxzckWLUGDFfF8RydSyngo44gDv8m2hHruUg==
@@ -575,6 +602,13 @@
"@octokit/openapi-types" "^4.0.0"
"@types/node" ">= 8"
"@octokit/types@^6.16.1", "@octokit/types@^6.17.3", "@octokit/types@^6.17.4":
version "6.17.4"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.17.4.tgz#5ec011bfe3d08b7605c7d92a15796c470ee541b6"
integrity sha512-Ghk/JC4zC/1al1GwH6p8jVX6pLdypSWmbnx6h79C/yo3DeaDd6MsNsBFlHu22KbkFh+CdcAzFqdP7UdPaPPmmA==
dependencies:
"@octokit/openapi-types" "^8.1.4"
"@sinonjs/commons@^1.7.0":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.2.tgz#858f5c4b48d80778fde4b9d541f27edc0d56488b"
@@ -926,10 +960,10 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"
before-after-hook@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.1.tgz#99ae36992b5cfab4a83f6bee74ab27835f28f405"
integrity sha512-5ekuQOvO04MDj7kYZJaMab2S8SPjGJbotVNyv7QYFCOAwrGZs/YnoDNlh1U+m5hl7H2D/+n0taaAV/tfyd3KMA==
before-after-hook@^2.2.0:
version "2.2.2"
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e"
integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==
brace-expansion@^1.1.7:
version "1.1.11"