Be verbose on ACTIONS_STEP_DEBUG

This commit is contained in:
Lars Gohr
2020-05-19 21:06:16 +02:00
parent 508d4eee28
commit 554d1b7c0e
2 changed files with 13 additions and 0 deletions

View File

@@ -4,6 +4,10 @@ set -e
function main() { function main() {
echo "" # see https://github.com/actions/toolkit/issues/168 echo "" # see https://github.com/actions/toolkit/issues/168
if usesBoolean "${ACTIONS_STEP_DEBUG}"; then
set -x
fi
sanitize "${INPUT_NAME}" "name" sanitize "${INPUT_NAME}" "name"
sanitize "${INPUT_USERNAME}" "username" sanitize "${INPUT_USERNAME}" "username"
sanitize "${INPUT_PASSWORD}" "password" sanitize "${INPUT_PASSWORD}" "password"

View File

@@ -563,6 +563,15 @@ teardown() {
/usr/local/bin/docker push my/repository:B" /usr/local/bin/docker push my/repository:B"
} }
@test "it is verbose on ACTIONS_STEP_DEBUG" {
export GITHUB_REF='refs/heads/master'
export ACTIONS_STEP_DEBUG=true
run /entrypoint.sh
expectStdOutContains "sanitize my/repository name" # prints the commands
}
function expectStdOutContains() { function expectStdOutContains() {
local expected=$(echo "${1}" | tr -d '\n') local expected=$(echo "${1}" | tr -d '\n')
local got=$(echo "${output}" | tr -d '\n') local got=$(echo "${output}" | tr -d '\n')