From af93991c19abd3c65cbc932a7635f4a33d57efd7 Mon Sep 17 00:00:00 2001 From: theimpulson Date: Wed, 11 Mar 2020 17:20:00 +0000 Subject: [PATCH 1/2] github-release-cli: Rename 'file' parameter to 'data' Fixes the following warning: { Deprecation: [@octokit/rest] "file" parameter is deprecated for ".repos.uploadReleaseAsset()". Use "data" instead at Object.keys.forEach.key (/usr/local/lib/node_modules/github-release-cli/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js:13145:26) at Array.forEach () at Object.patchedMethod [as uploadReleaseAsset] (/usr/local/lib/node_modules/github-release-cli/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js:13142:26) at _callee2$ (/usr/local/lib/node_modules/github-release-cli/lib/index.js:412:50) at tryCatch (/usr/local/lib/node_modules/github-release-cli/node_modules/regenerator-runtime/runtime.js:62:40) at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/github-release-cli/node_modules/regenerator-runtime/runtime.js:296:22) at Generator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/github-release-cli/node_modules/regenerator-runtime/runtime.js:114:21) at step (/usr/local/lib/node_modules/github-release-cli/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30) at /usr/local/lib/node_modules/github-release-cli/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13 at process._tickCallback (internal/process/next_tick.js:68:7) name: 'Deprecation' } Signed-off-by: Aayush Gupta --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index d090b80..38f2f23 100755 --- a/src/index.js +++ b/src/index.js @@ -150,7 +150,7 @@ const fn = { console.log(` #${i + 1}: name="${path.basename(file)}" filePath="${file}"`); await octokit.repos.uploadReleaseAsset({ url: release.upload_url, - file: fs.createReadStream(file), + data: fs.createReadStream(file), headers: { 'Content-Type': mime.lookup(file) || 'application/octet-stream', 'Content-Length': fs.statSync(file).size, From 1f6e6cd3ae0d3e3a2ef0630d7b3b242a718cf17b Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Tue, 11 Aug 2020 06:17:27 +0000 Subject: [PATCH 2/2] dependencies: Bump octokit's dependency and switch to named import Fixes the following warning: [@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead This is an octokit issue and has been fixed in later versions Ref: https://github.com/actions/toolkit/issues/333 Signed-off-by: Aayush Gupta --- package.json | 2 +- src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ba11951..9242a18 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "cli" ], "dependencies": { - "@octokit/rest": "^16.23.2", + "@octokit/rest": "^16.43.1", "babel-runtime": "^6.26.0", "chalk": "^2.4.2", "commander": "^2.20.0", diff --git a/src/index.js b/src/index.js index 38f2f23..e34efdf 100755 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ /* eslint max-len: 0 */ import fs from 'fs'; import path from 'path'; -import Octokit from '@octokit/rest'; +import {Octokit} from '@octokit/rest'; import chalk from 'chalk'; import program from 'commander'; import * as LinkHeader from 'http-link-header';