Skip to content

Instantly share code, notes, and snippets.

@TRahulSam1997
Created November 15, 2020 12:26
Show Gist options
  • Save TRahulSam1997/3cd6211b9bb2d72f5e468b32bc468393 to your computer and use it in GitHub Desktop.
Save TRahulSam1997/3cd6211b9bb2d72f5e468b32bc468393 to your computer and use it in GitHub Desktop.
function updateCommitStatus(commitURL, state, jenkinsTargetUrl, message, accessToken) {
let data = JSON.stringify({"state":`${state}`,"target_url":`${jenkinsTargetUrl}`,"description":`${message}`,"context":"continuous-integration/jenkins"});
let config = {
method: 'post',
url: `${commitURL}?access_token=${accessToken}`,
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment