Skip to content

Commit

Permalink
Merge pull request #9 from cropio/feat/pr_name_as_link
Browse files Browse the repository at this point in the history
add pr name to bot msg
  • Loading branch information
saintcode authored Jan 29, 2024
2 parents 490eb95 + 6dfcf2f commit 136ff3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/capistrano/messaging/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ def git_rev
`git rev-parse origin/#{fetch(:branch, "unknown")}`.strip!
end

def git_pr_msg
`git show --pretty=format:"%s" -s "#{short_rev}"`
end

def git_pr_link
"[#{git_pr_msg}](#{link_rev})"
end

def short_rev
git_rev[0..6]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/messaging/telegram.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def revert_ico

def message_for_updating
"#{start_ico} #{deployer} started deploying branch " \
"#{branch} of #{application} to #{stage} rev. #{link_rev}"
"#{branch} of #{application} to #{stage} rev. #{git_pr_link}"
end

def message_for_reverting
Expand Down

0 comments on commit 136ff3c

Please sign in to comment.