armbian_build/lib/functions/general/github-actions.sh
Igor Pečovnik b7b8eb7b72
Add / modify (c) in bash scripts (#4922)
* Add / modify (c) in bash scripts

Signed-off-by: Igor <igor@armbian.com>

* Add (c) to the source config files

---------

Signed-off-by: Igor <igor@armbian.com>
2023-03-09 18:30:40 +01:00

28 lines
776 B
Bash

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
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}'" "debug"
}