Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
style(SCRIPTS): standardize script headers
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Mar 5, 2023
1 parent de6a5a5 commit c93ca0b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions {{cookiecutter.project_slug}}/.github/scripts/notifications.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#!/bin/bash

# Takes two text arguments
# Message Format: <ARG1>: <ARG2>
# .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 "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c93ca0b

Please sign in to comment.