Using GitHub Checks Annotations from Azure Pipelines

463 Views Asked by At

Summary

I want to add annotations to GitHub CI runs from inside Azure Pipelines. I want to add these annotations to the CI Check Run that is performing the build. I do not know how to get at the GitHub Check Run identifier from inside Azure, and I do not know of any Azure-specific API for adding annotations to the job results.

Background Details

I would like to add Checks Annotations to GitHub Pull Requests using Azure DevOps CI.

Specifically, I want to pipe build failures from Clang/GCC or MSVC to annotations, as well as pipe requested changes from tools like clang-tidy or clang-format.

Writing a script that parses outputs from these tools and makes requests with GitHub Octokit is easy enough, if that is required, so I'm not worried about the mechanism of annotations.

I'm aware of the logging commands supported. However, even setting errors like:

##vso[task.logissue type=error;sourcepath=source/test.cpp;linenumber=7;columnnumber=20]Error

Does not set GitHub Annotations. Even if it did, I don't know how I could fit a multi-line comment (like a diff, or even most compiler errors for that matter) into a log-based structure like that.

The Problem

I would like to add these annotations to the existing Check Run that is running the script, but this requires that I be able to get the Check Run identifier.

Either I need to get at this id for my own purposes (and I don't know how!) or I need access to an API of some kind from inside Azure Pipelines that adds annotations (but I'm not aware of any).

0

There are 0 best solutions below