Skip to content

Commit

Permalink
add release url to the release name in slack msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Sep 30, 2024
1 parent 87c38dc commit ec2e1e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function release::create_github_release() {
echo -e "${COLOR_CYAN}--dry-run enabled. Skipping creating a release ($release_name)${COLOR_RESET}"
fi

slack::notify "$repo_info" "$release_name" "$changelog_url" "$commits"
slack::notify "$repo_info" "$release_name" "$changelog_url" "$commits" "$new_tag"
}

# shellcheck disable=SC2155
Expand Down
6 changes: 5 additions & 1 deletion src/slack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ function slack::notify() {
local release_name=$2
local changelog_url=$3
local commits=$4
local new_tag=$5

local repo_url="https://github.com/$repo_info"
local repo_name=$(echo "$repo_info" | cut -d'/' -f2)

local repo_name_url="<$repo_url|$repo_name>"
local release_name_url="<$repo_url/releases/tag/$new_tag|$release_name>"

local slack_message=$(cat <<EOF
{
"channel": "$SLACK_CHANNEL_ID",
Expand All @@ -26,7 +30,7 @@ function slack::notify() {
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<$repo_url|$repo_name>* :rocket: $release_name\n\n$commits\n<$changelog_url|Full changelog>"
"text": "*$repo_name_url* :rocket: $release_name_url\n\n$commits\n<$changelog_url|Full changelog>"
}
}
]
Expand Down

0 comments on commit ec2e1e5

Please sign in to comment.