diff --git a/{{cookiecutter.project_slug}}/.github/scripts/notifications.sh b/{{cookiecutter.project_slug}}/.github/scripts/notifications.sh index ecbecb36..c212119e 100755 --- a/{{cookiecutter.project_slug}}/.github/scripts/notifications.sh +++ b/{{cookiecutter.project_slug}}/.github/scripts/notifications.sh @@ -1,7 +1,19 @@ #!/bin/bash -# Takes two text arguments -# Message Format: : +# .github/scripts/notifications.sh +# Sends a notification to slack. -[[ -z ${WEBHOOK_URL} ]] && exit 0 -curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"${1}: ${2}\"}" "${WEBHOOK_URL}" +# 1: The branch information to display. +# 2: The notification message to send. +# WEBHOOK_URL: The slack webhook url to use. + +# CI only script. + +main() { + + [[ -z ${WEBHOOK_URL} ]] && exit 0 + curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"${1}: ${2}\"}" "${WEBHOOK_URL}" + +} + +main "$@" diff --git a/{{cookiecutter.project_slug}}/.github/scripts/pushed_commit_range.sh b/{{cookiecutter.project_slug}}/.github/scripts/pushed_commit_range.sh index 016e6638..2abadb50 100644 --- a/{{cookiecutter.project_slug}}/.github/scripts/pushed_commit_range.sh +++ b/{{cookiecutter.project_slug}}/.github/scripts/pushed_commit_range.sh @@ -3,7 +3,7 @@ # .github/scripts/pushed_commit_range.sh # Retrieves the range of the commits in a push, and sets the PUSHED_COMMIT_RANGE environment variables. -# GITHUB_CONTEXT: The github action context object as an environment variable. +# GITHUB_CONTEXT: The github action context object as an environment variable. # CI only script