Skip to content

Commit

Permalink
Merge pull request #11 from rtCamp/fix/issue-9
Browse files Browse the repository at this point in the history
Read hosts.yml only if present
  • Loading branch information
mrrobot47 committed Jan 17, 2020
2 parents 29a7871 + 6a14db3 commit a791c98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.sh
Expand Up @@ -10,7 +10,9 @@ export COMMIT_MESSAGE=$(cat "/github/workflow/event.json" | jq .commits | jq '.[
hosts_file="$GITHUB_WORKSPACE/.github/hosts.yml"

if [[ -z "$SLACK_CHANNEL" ]]; then
user_slack_channel=$(cat "$hosts_file" | shyaml get-value "$CI_SCRIPT_OPTIONS.slack-channel" | tr '[:upper:]' '[:lower:]')
if [[ -f "$hosts_file" ]]; then
user_slack_channel=$(cat "$hosts_file" | shyaml get-value "$CI_SCRIPT_OPTIONS.slack-channel" | tr '[:upper:]' '[:lower:]')
fi
fi

if [[ -n "$user_slack_channel" ]]; then
Expand Down

0 comments on commit a791c98

Please sign in to comment.