Skip to content

Instantly share code, notes, and snippets.

@GochoMugo
Last active May 21, 2020 06:18
Show Gist options
  • Save GochoMugo/9d04f06c6a001d0f7a84a12b2b21c376 to your computer and use it in GitHub Desktop.
Save GochoMugo/9d04f06c6a001d0f7a84a12b2b21c376 to your computer and use it in GitHub Desktop.
gitbeaker - bug report - reproduction - https://github.com/jdalrymple/gitbeaker/issues/832

Bug report at jdalrymple/gitbeaker#832.

To reproduce the bug:

$ npm install

$ export GITLAB_TOKEN=xxx
$ export GITLAB_PROJECT_ID=xxx

$ node index.js
const fs = require("fs");
const { Gitlab } = require("@gitbeaker/node");
const gitlab = new Gitlab({
token: process.env.GITLAB_TOKEN,
});
const content = fs.createReadStream(__filename);
gitlab.Projects.upload(parseInt(process.env.GITLAB_PROJECT_ID, 10), content, {
filename: __filename,
})
.then((res) => {
console.log("File upload successful:", res);
})
.catch((error) => {
console.error("File upload failed:", error);
});
{
"dependencies": {
"@gitbeaker/node": "^19.7.0",
"form-data": "^2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment