actions

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNotInGHA = errors.New("Not in GitHub Actions")

ErrorNotInGHA is the error returned when a function can only execute in GitHub Actions, but the current execution environment is NOT GitHub Actions

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	// The annotation's content body
	Message string

	// (optional) Custom title
	Title string

	// (optional) Filename
	File string

	// (optional) Line number, starting at 1
	Line int

	// (optional) Ending line number, starting at 1
	EndLine int
}

Annotation represents a message that can optionally be attributed to a specific file location in GitHub. It is shown in the Actions Workflow Run UI

type GHA

type GHA struct {
	// contains filtered or unexported fields
}

GHA helps write output for GitHub Actions-specific cases

func New

func New(out io.Writer) *GHA

New returns a new GitHub Actions Writer

func (*GHA) DisableGHAOutput

func (gha *GHA) DisableGHAOutput(in bool)

DisableGHAOutput forcibly disables GitHub Actions-specific output types (e.g., groups)

func (*GHA) EnableGHAOutput

func (gha *GHA) EnableGHAOutput()

EnableGHAOutput forcibly enables GitHub Actions-specific output types (e.g., groups)

func (*GHA) EndGroup

func (gha *GHA) EndGroup()

EndGroup ends a GitHub Actions logging group https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

func (*GHA) Error

func (gha *GHA) Error(a Annotation)

Error creates an error message and prints the message to the log. This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file.

func (*GHA) ExportVariable

func (gha *GHA) ExportVariable(name, value string) error

ExportVariable makes an environment variable available to subsequent steps https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable

func (*GHA) IsGHA

func (gha *GHA) IsGHA() bool

IsGHA returns true if the program is executing inside of GitHub Actions

func (*GHA) Notice

func (gha *GHA) Notice(a Annotation)

Notice creates a notice message and prints the message to the log This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file.

func (*GHA) SetJobSummary

func (gha *GHA) SetJobSummary(content string) error

SetJobSummary appends markdown displayed on the summary page of a workflow run https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable

func (*GHA) SetOutput

func (gha *GHA) SetOutput(name, value string) error

SetOutput generates a GitHub Actions output for the current job https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter

func (*GHA) StartGroup

func (gha *GHA) StartGroup(name string)

StartGroup creates a GitHub Actions logging group https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

func (*GHA) Warning

func (gha *GHA) Warning(a Annotation)

Warning creates a warning message and prints the message to the log. This message will create an annotation, which can associate the message with a particular file in your repository. Optionally, your message can specify a position within the file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL