Skip to content

Instantly share code, notes, and snippets.

@GochoMugo

GochoMugo/Readme.md

Last active May 21, 2020
Embed
What would you like to do?
gitbeaker - bug report - reproduction - https://github.com/jdalrymple/gitbeaker/issues/832
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