core

package
v0.0.0-...-3973644 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (

	// StatusFailed is returned by Status() in case this action has been marked as failed
	StatusFailed = 1
	// StatusSuccess is returned by Status() in case this action has not been marked as failed. By default an action is claimed as successful
	StatusSuccess = 0

	GitHubOutputFilePathEnvName    = "GITHUB_OUTPUT"
	GitHubStateFilePathEnvName     = "GITHUB_STATE"
	GitHubExportEnvFilePathEnvName = "GITHUB_ENV"
	GitHubPathFilePathEnvName      = "GITHUB_PATH"
	GitHubSummaryPathEnvName       = "GITHUB_STEP_SUMMARY"

	ActionsGoJsonInputEnvName = "ACTION_GO_INPUTS"
)
View Source
const EOF = "\n"

Variables

This section is empty.

Functions

func AddPath

func AddPath(path string)

AddPath prepends inputPath to the PATH (for this action and future actions)

func AddStepSummary

func AddStepSummary(summary string)

AddStepSummary adds some custom Markdown for each job so that it will be displayed on the summary page of a workflow run. You can use job summaries to display and group unique content, such as test result summaries, so that someone viewing the result of a workflow run doesn't need to go into the logs to see important information related to the run, such as failures. see: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary

func Debug

func Debug(message string)

Debug writes debug message to user log

func Debugf

func Debugf(format string, args ...interface{})

Debugf writes debug message to user log

func DeleteStepSummary

func DeleteStepSummary()

DeleteStepSummary completely remove a summary for the current step see: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#removing-job-summaries

func EndGroup

func EndGroup()

EndGroup end an output group and folds it

func Error

func Error(message string)

Error adds an error issue

func Errorf

func Errorf(format string, args ...interface{})

Errorf writes debug message to user log

func ExportVariable

func ExportVariable(name, value string)

ExportVariable sets the environment varaible name (for this action and future actions)

func GetBoolInput

func GetBoolInput(name string) bool

GetBoolInput gets the value of an input and returns whether it equals "true". In any other case, whether it does not equal, or the input is not set, false is returned

func GetInput

func GetInput(name string) (string, bool)

GetInput gets the value of an input. The value is also trimmed.

func GetInputOrDefault

func GetInputOrDefault(name, dflt string) string

GetInputOrDefault gets the value of an input. If value is not found, a default value is used

func GetState

func GetState(name string) string

GetState gets the value of an state set by this action's main execution.

func Group

func Group(name string, f func()) func()

Group wrap an asynchronous function call in a group, all logs of the function will be collapsed after completion

func Info

func Info(message string)

Info writes the message on the console

func Infof

func Infof(format string, args ...interface{})

Infof writes debug message to user log

func IsDebug

func IsDebug() bool

IsDebug returns whether the github actions is currently under debug

func Issue

func Issue(kind string, message ...string)

Issue displays a plain typed message following github actions interface

func IssueCommand

func IssueCommand(kind string, properties map[string]string, message string)

IssueCommand displays a typed message with properties following github actions interface. see https://github.com/actions/toolkit/blob/e69833ed16500afaa7d137a9cf6da76fb8fb54da/packages/core/src/command.ts#L19

func ReplaceStepSummary

func ReplaceStepSummary(summary string)

ReplaceStepSummary clear all content for the current step see: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#overwriting-job-summaries

func SaveState

func SaveState(name, value string)

SaveState saves state for current action, the state can only be retrieved by this action's post job execution.

func SetFailed

func SetFailed(message string)

SetFailed sets the action status to failed and sets an error message

func SetFailedf

func SetFailedf(format string, args ...interface{})

SetFailedf sets the action status to failed and sets an error message

func SetOutput

func SetOutput(name, value string)

SetOutput sets the value of an output for future actions

func SetSecret

func SetSecret(secret string)

SetSecret registers a secret which will get masked from logs

func SetStdout

func SetStdout(w io.Writer)

func StartCommands

func StartCommands(endToken string)

StartCommands enables commands stopped until the endToken

func StartGroup

func StartGroup(name string)

StartGroup begin an output group. Output until the next `GroupEnd` will be foldable in this group

func StopCommands

func StopCommands(endToken string)

StopCommands Stops processing any workflow commands. Commands will be resumed when calling StartCommands(endToken) This special command allows you to log anything without accidentally running a workflow command. For example, you could stop logging to output an entire script that has comments.

func Warning

func Warning(message string)

Warning adds a warning issue

func Warningf

func Warningf(format string, args ...interface{})

Warningf writes debug message to user log

func WithoutCommands

func WithoutCommands(endToken string, f func())

WithoutCommands executes the functions ensuring it does not execute any github actions commands. This special command allows you to log anything without accidentally running a workflow command. For example, you could stop logging to output an entire script that has comments.

Types

type File

type File interface {
	io.Reader
	io.Writer
	io.Closer
}

Jump to

Keyboard shortcuts

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