Make "commit statuses" API accept slashes in "ref" (#36264)

Fix #36253

Support slashes in `{ref}` (follow GitHub's behavior)
This commit is contained in:
wxiaoguang
2026-01-01 09:56:07 +08:00
committed by GitHub
parent 1771569300
commit 094104bc91
6 changed files with 94 additions and 145 deletions
+1 -6
View File
@@ -930,12 +930,7 @@ func Test_WebhookStatus(t *testing.T) {
testCtx := NewAPITestContext(t, "user2", "repo1", auth_model.AccessTokenScopeAll)
// update a status for a commit via API
doAPICreateCommitStatus(testCtx, commitID, api.CreateStatusOption{
State: commitstatus.CommitStatusSuccess,
TargetURL: "http://test.ci/",
Description: "",
Context: "testci",
})(t)
doAPICreateCommitStatusTest(testCtx, commitID, commitstatus.CommitStatusSuccess, "testci")(t)
// 3. validate the webhook is triggered
assert.Equal(t, "status", triggeredEvent)