Documentation
¶
Overview ¶
Package core is Go port of @actions/core. Core functions for setting results, logging, registering secrets and exporting variables across actions.
https://github.com/actions/toolkit/tree/master/packages/core
Index ¶
- func AddPath(inputPath string)
- func Debug(mes string, option *LogOption)
- func EndGroup()
- func Error(mes string, option *LogOption)
- func ExportVariable(name, value string)
- func GetInput(name string) string
- func GetState(name string) string
- func Info(mes string)
- func Issue(command string, message string)
- func IssueCommand(command string, properties CommandProperties, message string)
- func SaveState(name, value string)
- func SetOutput(name, value string)
- func SetSecret(value string)
- func StartGroup(name string)
- func Warning(mes string, option *LogOption)
- type Command
- type CommandProperties
- type LogOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPath ¶
func AddPath(inputPath string)
Prepends inputPath to the PATH (for this action and future actions).
func Debug ¶
Writes debug message to user log.
You can optionally provide a filename (file), line number (line), and column (col) number as LogOption where the warning occurred.
func Error ¶
Adds an error issue.
You can optionally provide a filename (file), line number (line), and column (col) number as LogOption where the warning occurred.
func ExportVariable ¶
func ExportVariable(name, value string)
Sets env variable for this action and future actions in the job.
func GetInput ¶
Gets the value of an input. The value is also trimmed. It will return empty string if input is not present.
func IssueCommand ¶
func IssueCommand(command string, properties CommandProperties, message string)
IssueCommand issues a Logging command of GitHub Actions.
func SaveState ¶
func SaveState(name, value string)
Saves state for current action, the state can only be retrieved by this action's post job execution.
func StartGroup ¶
func StartGroup(name string)
Begin an output group. Output until the next `groupEnd` will be foldable in this group.
Types ¶
type Command ¶
type Command struct {
Command string
Properties CommandProperties
Message string
}
func NewCommand ¶
func NewCommand(command string, properties CommandProperties, message string) Command
NewCommand creates a Logging command of GitHub Actions.
func (Command) String ¶
String returns command in logging command format.
It's port of https://github.com/actions/toolkit/blob/bfd29dcef82f324e9fb8855b6083fc0c2902bc27/packages/core/src/core.ts
type CommandProperties ¶
func NewCommandProperties ¶
func NewCommandProperties(kv ...string) CommandProperties
NewCommandProperties returns a new CommandProperties from a list of key, value string pairs.
NewCommandProperties panics if given an odd number of arguments.
func (CommandProperties) Add ¶
func (cp CommandProperties) Add(key, value string)
Add adds new properties.
func (CommandProperties) AddCol ¶
func (cp CommandProperties) AddCol(value int)
AddLine adds new col property.
func (CommandProperties) AddFile ¶
func (cp CommandProperties) AddFile(value string)
AddLine adds new file property.
func (CommandProperties) AddLine ¶
func (cp CommandProperties) AddLine(value int)
AddLine adds new line property.