I am trying to push a zip file to github from a bitbucket pipeline using nodejs
Currently using octonode a nice github api wrapper.
What I am trying to figure out is the process/steps on how to do this.
I was successful in programmatically creating the initial commit
var github = require('octonode');
const client = github.client(access_token);
const repo = client.repo('myuser/myrepo');
repo.createContents('my.zip', 'Initial Commit', zipFile, (err, data, headers) => {
});
But what to do next is where i end up in the weeds.
I was thinking, creating a branch off of master and then updating the zip file in that branch and then merge.
I can not seem to create a branch. I think i am suppose to use createReference, and suppose to use the sha of master??
By i can not find the sha of master.
repo.createReference('v1.0.0', 'sha', (err, data, headers) => {
console.log('in createReference callback---err---->', err);
console.log('in createReference callback---data---->', data);
console.log('in createReference callback---headers---->', headers);
});
The question is, is this the correct method??
my end goal , is to programmatically push a new zip file to github.
Thanks for any help/suggestions