Add commit URL to Slack notifications with link and backtick formatting
- Add commit_url column to webhook_events and deployments tables - Extract commit URL from webhook payload (from commit object or repo URL) - Format Slack messages with backticks for branch and commit SHA - Link commit SHA to the actual commit URL on the git server - Keep plain text format for ntfy notifications
This commit is contained in:
@@ -439,9 +439,15 @@ func (svc *Service) createDeploymentRecord(
|
||||
}
|
||||
}
|
||||
|
||||
// Set commit SHA from webhook event
|
||||
if webhookEvent != nil && webhookEvent.CommitSHA.Valid {
|
||||
deployment.CommitSHA = webhookEvent.CommitSHA
|
||||
// Set commit SHA and URL from webhook event
|
||||
if webhookEvent != nil {
|
||||
if webhookEvent.CommitSHA.Valid {
|
||||
deployment.CommitSHA = webhookEvent.CommitSHA
|
||||
}
|
||||
|
||||
if webhookEvent.CommitURL.Valid {
|
||||
deployment.CommitURL = webhookEvent.CommitURL
|
||||
}
|
||||
}
|
||||
|
||||
deployment.Status = models.DeploymentStatusBuilding
|
||||
|
||||
Reference in New Issue
Block a user