Hi team,
I'm working on a custom build task for Azure DevOps that needs to send notifications to GitHub whenever a pipeline run completes (either success or failure). I've looked into the GitHub API and Azure DevOps extension APIs, but I'm struggling to find a clean way to achieve this. Specifically, I want to post a commit status or a comment on a pull request.
Are there any existing community extensions or best practices for this kind of integration? Any guidance on how to authenticate with GitHub from within a custom Azure DevOps task would be greatly appreciated.
// Pseudocode example of what I'm trying to do
async function process(inputs) {
const githubToken = getSecret('GitHubPAT'); // Need to securely get this
const repoUrl = inputs.githubRepoUrl;
const commitSha = inputs.commitSha;
const pipelineResult = inputs.pipelineResult; // 'succeeded', 'failed', etc.
await sendGitHubStatus(githubToken, repoUrl, commitSha, pipelineResult);
}
Thanks in advance!