The ShellScript flavor of https://github.com/actions/toolkit
Use submodule, subtree or download toolkit.sh
and run source /path/to/toolkit.sh
in your project sources or your Dockerfile.
For now, behaviours are tested on Bash. However, some of statements may not be POSIX compatible so this toolkit won't work on some shells.
No special step is required to set up.
Please modify test/*.bats
to assure the validity of your changes and make sure bin/run_test.bash
succeeds.
github::set_env
github::set_env <name> <value>
cat<<EOF | github::set_env
<name> <value>
<name> <value>
...
EOF
github::set_output
github::set_output <name> <value>
cat<<EOF | github::set_output
<name> <value>
<name> <value>
...
EOF
github::debug
[file=</path/to/file> [line=<line number>]] github::debug <log message>
cat<<EOF | [file=</path/to/file> [line=<line number>]] github::debug
<log message>
<log message>
...
EOF
ref: https://help.github.com/en/articles/development-tools-for-github-actions#set-a-debug-message-debug
github::warning
[file=</path/to/file> [line=<line number> [col=<column number>]]] github::warning <log message>
cat<<EOF | [file=</path/to/file> [line=<line number> [col=<column number>]]] github::warning
<log message>
<log message>
...
EOF
ref: https://help.github.com/en/articles/development-tools-for-github-actions#set-a-warning-message-debug
github::error
[file=</path/to/file> [line=<line number> [col=<column number>]]] github::error <log message>
cat<<EOF | [file=</path/to/file> [line=<line number> [col=<column number>]]] github::error
<log message>
<log message>
...
EOF
ref: https://help.github.com/en/articles/development-tools-for-github-actions#set-a-error-message-debug
github::add_mask
github::add_mask <a value to be masked>
echo <a value to be masked> | github::add_mask # only first line will be masked
github::stop_commands
github::stop_commands <endtoken>
github::resume_commands
github::resume_commands <endtoken>
github::success
github::success # exit with zero code
github::failure
github::failure [exit_status] # exit with (exit_status || 1)