diff --git a/src/commands/notify.yml b/src/commands/notify.yml index a84cae25..dfd60498 100644 --- a/src/commands/notify.yml +++ b/src/commands/notify.yml @@ -63,6 +63,7 @@ parameters: default: true debug: description: | + Runs scripts in debug mode for bash. Enable to view full payload being sent to Slack and response being received from the API call. Redacted content can be viewed by re-running the job with SSH and accessing the log files referenced in the job output. When run in a persistent build environment such as CircleCI Runner, these debug log files may remain in the system's temporary filesystem indefinitely and accumulate over time. diff --git a/src/jobs/on-hold.yml b/src/jobs/on-hold.yml index 748793b1..4215801d 100644 --- a/src/jobs/on-hold.yml +++ b/src/jobs/on-hold.yml @@ -42,6 +42,7 @@ parameters: default: $SLACK_DEFAULT_CHANNEL debug: description: | + Runs scripts in debug mode for bash. View payload and response being sent to slack api. Enable to view full payload being sent to slack and response being received from the API call. type: boolean diff --git a/src/scripts/notify.sh b/src/scripts/notify.sh index 1a4b4935..ddc407ac 100644 --- a/src/scripts/notify.sh +++ b/src/scripts/notify.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash # shellcheck disable=SC2016,SC3043 +if [ "$SLACK_PARAM_DEBUG" -eq 1 ]; then + set -x +fi + # Import utils. eval "$SLACK_SCRIPT_UTILS" JQ_PATH=/usr/local/bin/jq @@ -298,3 +302,4 @@ if [ "${0#*"$ORB_TEST_ENV"}" = "$0" ]; then BuildMessageBody PostToSlack fi +set +x \ No newline at end of file