GithubActionOutput
Emits GitHub Actions workflow commands through the console output stream.
Description
The helper becomes a no-op outside GitHub Actions, which lets callers route annotations and log groups through a single API without branching on the environment first.
Properties
Methods
Closes any open group before the output instance is destroyed.
Emits a debug workflow command.
Ends the current collapsible log group.
Emits an error annotation for the current workflow step.
Runs a callback wrapped inside a GitHub Actions log group.
Emits a notice annotation for the current workflow step.
Starts a collapsible GitHub Actions log group.
Emits a warning annotation for the current workflow step.
Emits a raw workflow command after escaping its properties and payload.
Escapes workflow-command payload data according to GitHub Actions rules.
Escapes workflow-command property values according to GitHub Actions rules.
Determines whether workflow commands should be emitted for the current process.
public
__construct(ConsoleOutputInterface
$output) : mixed
Parameters
$output
:
ConsoleOutputInterface
Description
the console output used to emit workflow commands
Closes any open group before the output instance is destroyed.
public
__destruct() : mixed
Emits a debug workflow command.
public
debug(
string
$message) : void
Parameters
$message
:
string
Description
the debug message
Ends the current collapsible log group.
public
endGroup() : void
Emits an error annotation for the current workflow step.
public
error(
string
$message[,
string|null
$file = null][,
int|null
$line = null][,
int|null
$column = null]) : void
Parameters
$message
:
string
Description
the annotation message
$file
:
string|null
=
null
Description
the related file when known
$line
:
int|null
=
null
Description
the related line when known
$column
:
int|null
=
null
Description
the related column when known
Runs a callback wrapped inside a GitHub Actions log group.
public
group(
string
$title,
callable(): TResult
$callback) : TResult
Parameters
$title
:
string
Description
the group title
$callback
:
callable(): TResult
Description
the callback to execute within the group
Return values
Emits a notice annotation for the current workflow step.
public
notice(
string
$message[,
string|null
$file = null][,
int|null
$line = null][,
int|null
$column = null]) : void
Parameters
$message
:
string
Description
the annotation message
$file
:
string|null
=
null
Description
the related file when known
$line
:
int|null
=
null
Description
the related line when known
$column
:
int|null
=
null
Description
the related column when known
Starts a collapsible GitHub Actions log group.
public
startGroup(
string
$title) : void
Parameters
$title
:
string
Description
the group title
Emits a warning annotation for the current workflow step.
public
warning(
string
$message[,
string|null
$file = null][,
int|null
$line = null][,
int|null
$column = null]) : void
Parameters
$message
:
string
Description
the annotation message
$file
:
string|null
=
null
Description
the related file when known
$line
:
int|null
=
null
Description
the related line when known
$column
:
int|null
=
null
Description
the related column when known
Emits a raw workflow command after escaping its properties and payload.
private
emit(
string
$command[,
string
$message = ''][,
array<string, string>
$properties = []]) : void
Parameters
$command
:
string
Description
the GitHub workflow command name
$message
:
string
=
''
Description
the command message
$properties
:
array<string, string>
=
[]
Description
the optional command properties
Escapes workflow-command payload data according to GitHub Actions rules.
private
escapeData(
string
$data) : string
Parameters
$data
:
string
Return values
Escapes workflow-command property values according to GitHub Actions rules.
private
escapeProperty(
string
$property) : string
Parameters
$property
:
string
Return values
Determines whether workflow commands should be emitted for the current process.
private
supportsWorkflowCommands() : bool
Description
The helper suppresses workflow commands during the PHPUnit suite even when the tests themselves run inside GitHub Actions.
Return values
Description
true when the current environment supports GitHub workflow commands