Skip to content

Commit

Permalink
feat: slack_ci_report requires the ci step name
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Mar 13, 2024
1 parent 9a1f34f commit 1c3f74c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -594,15 +594,16 @@ slack_color_log() {

# Report ci job result to slack channel
# Expected usage is to do the following:
# trap 'slack_ci_report "$ROOT_DIR" "$?" "$SLACK_WEBHOOK_APPS"' EXIT
# trap 'slack_ci_report "$ROOT_DIR" "CI step name" "$?" "$SLACK_WEBHOOK_APPS"' EXIT
# Exit code 0 = success, anything else is failure
# Arg1: the repository root
# Arg2: the exit code of the ci job
# Arg3: the slack webhook where to push report
slack_ci_report() {
local REPO_DIR="$1"
local RET_CODE="$2"
local SLACK_WEBHOOK="$3"
local CI_STEP_NAME="$2"
local RET_CODE="$3"
local SLACK_WEBHOOK="$4"

local STATUS="success"
local COLOR="#2eb886"
Expand All @@ -613,7 +614,7 @@ slack_ci_report() {
github)
MESSAGE=$(printf "*%s*: %s %s *@%s* (%s, <%s|repo>, <%s|commit>, <%s|run>)" \
"$GITHUB_REPOSITORY" \
"$GITHUB_WORKFLOW" \
"$CI_STEP_NAME" \
"$STATUS" \
"$GITHUB_REF_NAME" \
"$GITHUB_ACTOR" \
Expand Down

0 comments on commit 1c3f74c

Please sign in to comment.