cheton / github-release-cli

A command-line tool for managing release assets on a GitHub repository.
MIT License
72 stars 17 forks source link

Github warning for depreciation of "file" parameter #15

Closed theimpulson closed 4 years ago

theimpulson commented 4 years ago

Hey!

I am getting a warning since uploads that [@octokit/rest] "file" parameter is deprecated for ".repos.uploadReleaseAsset()". Use "data" instead. Below is the complete log.

aayush@packet:/raid/los/out/target/product/PL2$ github-release upload --owner nokia-dev --repo android_device_nokia_sdm660-common --tag "test" --name "lineage-17.1-20200311-UNOFFICIAL" lineage-17.1-20200311-UNOFFICIAL-PL2.zip
[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead
> getReleaseByTag: owner=nokia-dev, repo=android_device_nokia_sdm660-common, tag=test
No release found.
> createRelease: tag_name=test, target_commitish=, name=lineage-17.1-20200311-UNOFFICIAL, draft=false, prerelease=false
> uploadReleaseAsset: assets_url=https://api.github.com/repos/nokia-dev/android_device_nokia_sdm660-common/releases/24431050/assets
  #1: name="lineage-17.1-20200311-UNOFFICIAL-PL2.zip" filePath="lineage-17.1-20200311-UNOFFICIAL-PL2.zip"
{ 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 (<anonymous>)
    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' }

I wonder if the following commit is responsible for it: https://github.com/octokit/rest.js/commit/dc2cc518837b53fc56977327799da44992a1f5cf

cheton commented 4 years ago

Would you mind submitting a PR to fix the deprecation warning? The line of code is supposted to be here: https://github.com/cheton/github-release-cli/blob/v1.3.1/src/index.js#L153

geekyfox90 commented 4 years ago

Any updates ?

theimpulson commented 4 years ago

Sorry for the late updates on this, I was busy during this crisis and it completely slipped out of mind. I just opened a PR. Please check and verify.

geekyfox90 commented 4 years ago

@cheton could you please merge the pull request ?

orhun commented 4 years ago

@cheton I'm getting the same error. Merging the PR will probably solve this issue.

theimpulson commented 4 years ago

I have force pushed my repository in order to fix one more depreciation warning as well as improved the commit message of the earlier commit

cheton commented 4 years ago

fixed in #22