dotnet / dotnet/msbuild

[CI logging] Implement GitHub Actions CI writer

Open
#14,654 0 comments 0 reactions 0 assignees View on GitHub
Area: Logging triaged User Experience
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Summary

Implement the GitHub Actions provider writer for the CI logger.

### Background and Motivation

GitHub Actions recognizes workflow commands written to standard output and displays them as native annotations. The command protocol has provider-specific formatting, escaping, and source-path requirements.

### Proposed Feature

Add `GitHubActionsWriter` as an `ICiProviderWriter` implementation.

It will:

- emit `error` and `warning` workflow commands;
- include diagnostic title, file, line, column, and ranges when available;
- escape message data and command properties according to the GitHub Actions protocol;
- map repository files relative to `GITHUB_WORKSPACE`;
- omit invalid or unsupported location properties rather than emitting malformed commands;
- write each annotation as one complete output line.

Provider-specific formatting and path policy will remain isolated from `CiLogger` and `BuildEventTracker`.

Validation should cover `%`, commas, colons, CR/LF, Unicode, missing locations, invalid coordinates, workspace-relative paths, and files outside the workspace.

### Alternative Designs

Formatting commands directly in `CiLogger` would couple provider-independent behavior to GitHub Actions and make future providers harder to add.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the ICiProviderWriter interface and the provider-specific integration points around CiLogger and BuildEventTracker. Define the GitHubActionsWriter boundary, then validate workflow-command escaping, diagnostic properties, workspace-relative paths, invalid locations, and one-line output against the listed cases. Done means error and warning annotations are emitted without coupling provider logic into the shared logger.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, github-actions
Domain
build-system, ci-cd
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.