Skip to content

Commit 1b2b28b

Browse files
authored
Merge pull request #13 from mercari/status-check-description-prefix
Add StatusCheckDescriptionPrefix
2 parents edeff76 + 73e1ca3 commit 1b2b28b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

server/handler/eval_context.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,17 @@ func (ec *EvalContext) PostStatus(ctx context.Context, state, message string) {
190190
context = ec.Options.StatusCheckContext
191191
}
192192

193+
var description string
194+
if ec.Options.StatusCheckDescriptionPrefix != "" {
195+
description = fmt.Sprintf("%s %s", ec.Options.StatusCheckDescriptionPrefix, message)
196+
} else {
197+
description = message
198+
}
199+
193200
status := github.RepoStatus{
194201
State: &state,
195202
Context: github.Ptr(context),
196-
Description: &message,
203+
Description: &description,
197204
TargetURL: &detailsURL,
198205
}
199206

server/handler/eval_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ type PullEvaluationOptions struct {
4343
// pattern: <StatusCheckContext>
4444
StatusCheckContextIgnoreBase bool `yaml:"status_check_context_ignore_base"`
4545

46+
// StatusCheckDescriptionPrefix will be used to prefix the status check description, with a space inserted.
47+
StatusCheckDescriptionPrefix string `yaml:"status_check_description_prefix"`
48+
4649
// ExpandRequiredReviewers enables a UI feature where the details page
4750
// shows a list of the users who can approve each rule. Enabling this
4851
// feature can leak information about team membership and permissions that

0 commit comments

Comments
 (0)