Files
load-secrets-action/tests/assert-env-unset.sh
2026-03-10 16:01:04 -04:00

28 lines
595 B
Bash
Executable File

#!/bin/bash
# shellcheck disable=SC2086
set -e
assert_env_unset() {
if [ -n "$(printenv $1)" ]; then
echo "Expected secret $1 to be unset"
exit 1
fi
}
assert_env_unset "SECRET"
assert_env_unset "FILE_SECRET"
assert_env_unset "SECRET_IN_SECTION"
assert_env_unset "FILE_SECRET_IN_SECTION"
assert_env_unset "MULTILINE_SECRET"
assert_env_unset "FILE_MULTILINE_SECRET"
assert_env_unset "WEBSITE"
assert_env_unset "FILE_WEBSITE"
assert_env_unset "TEST_SSH_KEY"
assert_env_unset "FILE_TEST_SSH_KEY"
assert_env_unset "TEST_SSH_KEY_OPENSSH"
assert_env_unset "FILE_TEST_SSH_KEY_OPENSSH"