Hamelin.Runtimes.GitHubActions 3.0.0

dotnet add package Hamelin.Runtimes.GitHubActions --version 3.0.0
                    
NuGet\Install-Package Hamelin.Runtimes.GitHubActions -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hamelin.Runtimes.GitHubActions" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hamelin.Runtimes.GitHubActions" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Hamelin.Runtimes.GitHubActions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Hamelin.Runtimes.GitHubActions --version 3.0.0
                    
#r "nuget: Hamelin.Runtimes.GitHubActions, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Hamelin.Runtimes.GitHubActions@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Hamelin.Runtimes.GitHubActions&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Hamelin.Runtimes.GitHubActions&version=3.0.0
                    
Install as a Cake Tool

Hamelin.Runtimes.GitHubActions

Pull Request Release

This package adds integration for running Hamelin pipelines in a GitHub Actions environment.

Installation

To install the package, you can use the following command:

dotnet add package Hamelin.Runtimes.GitHubActions

Usage

Registration

To add GitHub Actions runtime support to your Hamelin pipeline, you can use the AddGitHubActionsRuntime extension method on the IServiceCollection.

Runtime integration will only be fully registered if the GitHubActionsRuntimeOptions.RuntimeDetector detects that the application is running in a GitHub Actions environment. See Runtime Detection for more details.

using Hamelin;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = PipelineApplication.CreateBuilder(args);

builder.Services
    .AddGitHubActionsRuntime();

// ...

var pipeline = builder.Build();

// ...

await pipeline.RunAsync();

Options

You can configure the GitHub Actions runtime by providing options to the AddGitHubActionsRuntime method. The options allow you to customize the behavior of the runtime, such as the runtime detector and logging settings.s

Runtime Detection

The runtime integration will only be fully registered if the RuntimeDetector delegate returns true. By default, this is done by checking for the presence of the GITHUB_ACTIONS environment variable. If you need to customize this behavior, you can provide your own RuntimeDetector implementation.

If the runtime isn't detected, you will still be able to inject IGitHubActionsCommands into your pipeline steps, but a stub implementation will be resolved instead.

If you need to check if the runtime is detected, you can inject the IGitHubActionsContext interface, which provides an IsEnabled property.

Logging

The GitHub Actions integration includes a logging formatter that adapts the logging output for GitHub Actions. Warnings and errors are raised as notices on the pipeline, and debug logs are outputted using ::debug:: syntax which makes them respect GitHub Actions' debug setting.

Commands

With the GitHub Actions integration registered, you can inject the IGitHubActionsCommands interface into your pipeline steps to run commands in the GitHub Actions environment, including manually writing logs, grouping log messages and setting outputs.

Log Messages

You can log messages directly to the GitHub Actions log using the LogNotice, LogWarning and LogError methods:

public class MyPipelineStep(IGitHubActionsCommands gh) : IPipelineStep
{
    public Task Run(CancellationToken cancellationToken = new())
    {
        gh.LogError(
            message: "This is an error message.",
            title: "Notice",
            file: "README.md",
            startLine: 1,
            endLine: 1,
            startColumn: 1,
            endColumn: 1
        );
        return Task.CompletedTask;
    }
}
Log Grouping

Logs are grouped automatically by pipeline step. However, you can also create custom log groups using the StartGroup and EndGroup methods, or the WithGroup method. GitHub Actions logs don't support nested groups, so this functionality is mostly useful for creating groups outside of pipeline steps such as in hooks.

public class MyPipelineStep(ILogger<MyPipelineStep> logger, GitHubActionsCommands gh) : IPipelineStep
{
    public Task Run(CancellationToken cancellationToken = new())
    {
        gh.BeginGroup("My Custom Group");
        logger.LogInformation("This log is inside the custom group.");
        gh.EndGroup();

        using (gh.WithGroup("My Other Custom Group"))
        {
            logger.LogInformation("This log is inside the other custom group.");
        }
        return Task.CompletedTask;
    }
}
Job Summaries

GitHub Actions supports job summaries that are displayed in the UI after a job completes. You can append content to the job summary using the AppendJobSummary method. Internally, this writes to a file specified by the GITHUB_STEP_SUMMARY environment variable, so you can call this method multiple times to append content.

public class MyPipelineStep(ILogger<MyPipelineStep> logger, GitHubActionsCommands gh) : IPipelineStep
{
    public async Task Run(CancellationToken cancellationToken = new())
    {
        await gh.AppendJobSummary("# Job Summary\nThis is the summary of the job.");
    }
}
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 5,185 11/16/2025
2.0.0 478 11/3/2025
1.0.1 948 9/11/2025
1.0.0 229 9/11/2025
0.1.0 258 9/11/2025
0.0.4 282 8/14/2025
0.0.3 246 8/14/2025
0.0.2 222 8/13/2025
0.0.1 228 8/13/2025