Bug report at jdalrymple/gitbeaker#832.
To reproduce the bug:
$ npm install
$ export GITLAB_TOKEN=xxx
$ export GITLAB_PROJECT_ID=xxx
$ node index.js
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" | |
} | |
} |