~emersion/hottub

543abd2db07ad84a1b53882b59a85f5e15547e31 — Simon Ser 6 months ago eeb28f3
Guard against long descriptions
1 files changed, 4 insertions(+), 0 deletions(-)

M main.go
M main.go => main.go +4 -0
@@ 616,6 616,10 @@ func jobStatusToGitHub(jobStatus buildssrht.JobStatus) (state, description strin
}

func updateRepoStatus(ctx *checkSuiteContext, repoStatus *github.RepoStatus, state, description string) error {
	// GitHub rejects updates when description exceeds 140 characters
	if len(description) > 140 {
		description = description[:140]
	}
	repoStatus = &github.RepoStatus{
		TargetURL:   repoStatus.TargetURL,
		Context:     repoStatus.Context,