You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+1
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,7 @@ SLACK_FOOTER | Powered By rtCamp's GitHub Actions Library | S
56
56
MSG_MINIMAL | - | If set to `true`, removes: `Ref`, `Event`, `Actions URL` and `Commit` from the message. You can optionally whitelist any of these 4 removed values by passing it comma separated to the variable instead of `true`. (ex: `MSG_MINIMAL: event` or `MSG_MINIMAL: ref,actions url`, etc.)
57
57
SLACKIFY_MARKDOWN | - | If set to `true`, it will convert markdown to slack format. (ex: `*bold*`to `bold`) Note: This only works for custom messages and not for the default message generated by the action. Credits: [slackify-markdown-action](https://github.com/marketplace/actions/slack-markdown-converter)
58
58
SLACK_THREAD_TS | - | If you want to send message in a thread, you can pass the timestamp of the parent message to this variable. You can get the timestamp of the parent message from the message URL in Slack. (ex: `SLACK_THREAD_TS: 1586130833.000100`)
59
+
SLACK_TOKEN | - | If you want to send message to a channel using a slack token. You will need to pass a channel in order to send messages using token, requiring a value for ``SLACK_CHANNEL``. Note that in case both webhook url and token are provided, webhook url will be prioritized.
59
60
SLACK_ON_SUCCESS | - | If set, will send the provided message instead of the default message when the passed status (through ``SLACK_COLOR``) is `success`.
60
61
SLACK_ON_FAILURE | - | If set, will send the provided message instead of the default message when the passed status (through ``SLACK_COLOR``) is `failure`.
61
62
SLACK_ON_CANCEL | - | If set, will send the provided message instead of the default message when the passed status (through ``SLACK_COLOR``) is `cancelled`.
Copy file name to clipboardexpand all lines: entrypoint.sh
+10-1
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
3
3
# Check required env variables
4
4
flag=0
5
+
mode="WEBHOOK"
5
6
if [[ -z"$SLACK_WEBHOOK" ]];then
6
7
flag=1
7
8
missing_secret="SLACK_WEBHOOK"
@@ -13,11 +14,19 @@ if [[ -z "$SLACK_WEBHOOK" ]]; then
13
14
fi
14
15
fi
15
16
17
+
if [[ "$flag"-eq 1 ]] && [[ -n"$SLACK_TOKEN"||-n"$SLACK_CHANNEL" ]] ;then
18
+
# Basically, if both SLACK_TOKEN and SLACK_CHANNEL are provided, then it's a token mode
19
+
flag=0
20
+
mode="TOKEN"
21
+
fi
22
+
16
23
if [[ "$flag"-eq 1 ]];then
17
-
printf"[\e[0;31mERROR\e[0m] Secret \`$missing_secret\` is missing. Please add it to this action for proper execution.\nRefer https://github.com/rtCamp/action-slack-notify for more information.\n"
24
+
echo -e "[\e[0;31mERROR\e[0m] Secret \`$missing_secret\` is missing. Alternatively, a pair of \`SLACK_TOKEN\` and \`SLACK_CHANNEL\` can be provided. Please add it to this action for proper execution.\nRefer https://github.com/rtCamp/action-slack-notify for more information.\n"
0 commit comments