IGitHubActionsProvider.

Environment Property

Summary

Gets the GitHub Actions environment.

Syntax

GitHubActionsEnvironmentInfo Environment { get; }

Examples

if (BuildSystem.GitHubActions.IsRunningOnGitHubActions)
{
    Information(
        @"Workflow:
        Workflow: {0}
        Repository: {1}
        Actor: {2}
        Runner OS: {3}
        Runner Environment: {4}
        Runner Architecture: {5}",
        BuildSystem.GitHubActions.Environment.Workflow.Workflow,
        BuildSystem.GitHubActions.Environment.Workflow.Repository,
        BuildSystem.GitHubActions.Environment.Workflow.Actor,
        BuildSystem.GitHubActions.Environment.Runner.OS,
        BuildSystem.GitHubActions.Environment.Runner.Environment,
        BuildSystem.GitHubActions.Environment.Runner.Architecture
        );
}
else
{
    Information("Not running on GitHub Actions");
}
if (GitHubActions.IsRunningOnGitHubActions)
{
    Information(
        @"Workflow:
        Workflow: {0}
        Repository: {1}
        Actor: {2}
        Runner OS: {3}
        Runner Environment: {4}
        Runner Architecture: {5}",
        GitHubActions.Environment.Workflow.Workflow,
        GitHubActions.Environment.Workflow.Repository,
        GitHubActions.Environment.Workflow.Actor,
        GitHubActions.Environment.Runner.OS,
        GitHubActions.Environment.Runner.Environment,
        GitHubActions.Environment.Runner.Architecture
        );
}
else
{
    Information("Not running on GitHub Actions");
}

Value

Type Description
GitHubActionsEnvironmentInfo The GitHub Actions environment.