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

Backport #36264 by wxiaoguang

Fix #36253

Support slashes in `{ref}` (follow GitHub's behavior)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2026-01-01 03:04:03 +00:00
committed by GitHub
co-authored by wxiaoguang
parent 7d010c6932
commit 163113d173
6 changed files with 94 additions and 145 deletions
+1 -6
View File
@@ -934,12 +934,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)