This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style(SCRIPTS): standardize script headers
- Loading branch information
1 parent
de6a5a5
commit c93ca0b
Showing
2 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
20 changes: 16 additions & 4 deletions
20
{{cookiecutter.project_slug}}/.github/scripts/notifications.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters