tests: fix nounset error with $GITHUB_ENV

Initialize $GITHUB_ENV to avoid nounset error when running the scripts locally
out of Github Actions.

Fixed commit 9ba5e3d2a8

Fixes #9217
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
Wainer dos Santos Moschetta 2024-03-13 14:53:53 -03:00
parent ac27caf1b4
commit 981f95df55
2 changed files with 2 additions and 2 deletions

View File

@ -213,7 +213,7 @@ function run_tests() {
# In case of running on Github workflow it needs to save the start time
# on the environment variables file so that the variable is exported on
# next workflow steps.
if [ -n "$GITHUB_ENV" ]; then
if [ -n "${GITHUB_ENV:-}" ]; then
start_time=$(date '+%Y-%m-%d %H:%M:%S')
export start_time
echo "start_time=${start_time}" >> "$GITHUB_ENV"

View File

@ -95,7 +95,7 @@ function run() {
enabling_hypervisor
if [ -n "$GITHUB_ENV" ]; then
if [ -n "${GITHUB_ENV:-}" ]; then
start_time=$(date '+%Y-%m-%d %H:%M:%S')
export start_time
echo "start_time=${start_time}" >> "$GITHUB_ENV"