File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,14 +20,18 @@ if [[ -n "$user_slack_channel" ]]; then
2020 export SLACK_CHANNEL=" $user_slack_channel "
2121fi
2222
23- # Login to vault using GH Token
24- if [[ -n " $VAULT_GITHUB_TOKEN " ]]; then
25- unset VAULT_TOKEN
26- vault login -method=github token=" $VAULT_GITHUB_TOKEN " > /dev/null
27- fi
23+ # Check vault only if SLACK_WEBHOOK is empty.
24+ if [[ -z " $SLACK_WEBHOOK " ]]; then
25+
26+ # Login to vault using GH Token
27+ if [[ -n " $VAULT_GITHUB_TOKEN " ]]; then
28+ unset VAULT_TOKEN
29+ vault login -method=github token=" $VAULT_GITHUB_TOKEN " > /dev/null
30+ fi
2831
29- if [[ -n " $VAULT_GITHUB_TOKEN " ]] || [[ -n " $VAULT_TOKEN " ]]; then
30- export SLACK_WEBHOOK=$( vault read -field=webhook secret/slack)
32+ if [[ -n " $VAULT_GITHUB_TOKEN " ]] || [[ -n " $VAULT_TOKEN " ]]; then
33+ export SLACK_WEBHOOK=$( vault read -field=webhook secret/slack)
34+ fi
3135fi
3236
3337if [[ -f " $hosts_file " ]]; then
You can’t perform that action at this time.
0 commit comments