Skip to content

Commit 413a1d4

Browse files
authored
add backend instructions (#2090)
1 parent 0e8bd72 commit 413a1d4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

backend/utils/comment_utils.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ func GenerateRealtimeCommentMessage(jobs []models.DiggerJob, batchType orchestra
177177
resourcesDeleted)
178178
}
179179

180+
// Add instruction helpers (same as CLI)
181+
message += "\n" + formatExampleCommands()
182+
180183
// Handle comment length limits
181184
const GithubCommentMaxLength = 65536
182185
if len(message) > GithubCommentMaxLength {
@@ -190,6 +193,27 @@ func GenerateRealtimeCommentMessage(jobs []models.DiggerJob, batchType orchestra
190193
return message, nil
191194
}
192195

196+
// formatExampleCommands creates a collapsible markdown section with example commands
197+
// This matches the exact format used by the CLI's BasicCommentUpdater
198+
func formatExampleCommands() string {
199+
return `
200+
<details>
201+
<summary>Instructions</summary>
202+
203+
⏩ To apply these changes, run the following command:
204+
205+
` + "```" + `bash
206+
digger apply
207+
` + "```" + `
208+
209+
🚮 To unlock the projects in this PR run the following command:
210+
` + "```" + `bash
211+
digger unlock
212+
` + "```" + `
213+
</details>
214+
`
215+
}
216+
193217
// UpdateOrCreateSummaryComment updates or creates the summary comment for the batch
194218
func UpdateOrCreateSummaryComment(prService ci.PullRequestService, batch *models.DiggerBatch, message string) (*int64, error) {
195219
if batch.CommentId != nil {

0 commit comments

Comments
 (0)