armbian_build/lib/functions/general/github-actions.sh
Ricardo Pardini 1cec42392e
armbian-next: GHA & rootfs adventures, pt 1
- rootfs: create readonly global `rootfs_cache_id` (type+hash+date/version)
- add "oras-upload" CLI command (dumb, no retries, single target/single source)
- docker: mount-bind for & re-pass envs `GITHUB_OUTPUT` and `GITHUB_STEP_SUMMARY` down to Docker
- introduce `github-actions.sh::github_actions_add_output()`
- during logs cleanup, dump the Markdown log into GITHUB_STEP_SUMMARY if it is available
2023-02-18 07:44:41 -03:00

19 lines
566 B
Bash

function github_actions_add_output() {
# if CI is not GitHub Actions, do nothing
if [[ "${CI}" != "true" ]] && [[ "${GITHUB_ACTIONS}" != "true" ]]; then
display_alert "Not running in GitHub Actions, not adding output" "'${*}'" "debug"
return 0
fi
if [[ ! -f "${GITHUB_OUTPUT}" ]]; then
exit_with_error "GITHUB_OUTPUT file not found '${GITHUB_OUTPUT}'"
fi
local output_name="$1"
shift
local output_value="$*"
echo "${output_name}=${output_value}" >> "${GITHUB_OUTPUT}"
display_alert "Added GHA output" "'${output_name}'='${output_value}'" "info"
}