From c93ca0b969cd6d773b98ff0a0bd8d15e9465136d Mon Sep 17 00:00:00 2001 From: Niall Byrne <9848926+niall-byrne@users.noreply.github.com> Date: Sat, 25 Feb 2023 10:52:33 -0500 Subject: [PATCH] style(SCRIPTS): standardize script headers --- .../.github/scripts/notifications.sh | 20 +++++++++++++++---- .../.github/scripts/pushed_commit_range.sh | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) 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