@@ -58,7 +58,7 @@ func replyString(mux *http.ServeMux, url, body string) {
5858 })
5959}
6060
61- func testSetupCommonGhReplies (t * testing.T , mux * http.ServeMux , runevent info.Event , finalStatus , finalStatusText string , noReplyOrgPublicMembers bool ) {
61+ func testSetupCommonGhReplies (t * testing.T , mux * http.ServeMux , runevent info.Event , finalStatus , finalStatusText string , noReplyOrgPublicMembers bool , commitMessage string ) {
6262 t .Helper ()
6363 // Take a directory and generate replies as Github for it
6464 replyString (mux ,
@@ -72,11 +72,19 @@ func testSetupCommonGhReplies(t *testing.T, mux *http.ServeMux, runevent info.Ev
7272 fmt .Sprintf ("/repos/%s/%s/statuses/%s" , runevent .Organization , runevent .Repository , runevent .SHA ),
7373 "{}" )
7474
75- jj := fmt .Sprintf (`{"sha": "%s", "html_url": "https://git.commit.url/%s", "message": "commit message"}` ,
76- runevent .SHA , runevent .SHA )
75+ commitMsg := "commit message"
76+ if commitMessage != "" {
77+ commitMsg = commitMessage
78+ }
79+ commitJSON , err := json .Marshal (map [string ]string {
80+ "sha" : runevent .SHA ,
81+ "html_url" : "https://git.commit.url/" + runevent .SHA ,
82+ "message" : commitMsg ,
83+ })
84+ assert .NilError (t , err )
7785 replyString (mux ,
7886 fmt .Sprintf ("/repos/%s/%s/git/commits/%s" , runevent .Organization , runevent .Repository , runevent .SHA ),
79- jj )
87+ string ( commitJSON ) )
8088
8189 if ! noReplyOrgPublicMembers {
8290 mux .HandleFunc ("/orgs/" + runevent .Organization + "/members" , func (rw http.ResponseWriter , _ * http.Request ) {
@@ -137,6 +145,7 @@ func TestRun(t *testing.T) {
137145 PayloadEncodedSecret string
138146 concurrencyLimit int
139147 expectedLogSnippet string
148+ commitMessage string
140149 expectedPostedComment string // TODO: multiple posted comments when we need it
141150 secretCreationError error // Error to inject for secret creation
142151 }{
@@ -357,6 +366,27 @@ func TestRun(t *testing.T) {
357366 tektondir : "testdata/push_branch" ,
358367 finalStatus : "neutral" ,
359368 },
369+ {
370+ // Incoming webhooks are explicit user-triggered runs, so a skip-CI
371+ // marker in the head commit message must not suppress them.
372+ name : "Incoming/skip-ci-marker-is-ignored" ,
373+ runevent : info.Event {
374+ SHA : "resolvedsha123" ,
375+ Organization : "organizationes" ,
376+ Repository : "lagaffe" ,
377+ URL : "https://service/documentation" ,
378+ Sender : "incoming" ,
379+ HeadBranch : "refs/heads/main" ,
380+ BaseBranch : "refs/heads/main" ,
381+ DefaultBranch : "main" ,
382+ EventType : triggertype .Incoming .String (),
383+ TriggerTarget : "push" ,
384+ },
385+ tektondir : "testdata/push_branch" ,
386+ commitMessage : "fix: update docs [skip ci]" ,
387+ finalStatus : "neutral" ,
388+ expectedLogSnippet : "has been created" ,
389+ },
360390 {
361391 name : "Push/tags" ,
362392 runevent : info.Event {
@@ -611,7 +641,7 @@ func TestRun(t *testing.T) {
611641 },
612642 }
613643
614- testSetupCommonGhReplies (t , mux , tt .runevent , tt .finalStatus , tt .finalStatusText , tt .skipReplyingOrgPublicMembers )
644+ testSetupCommonGhReplies (t , mux , tt .runevent , tt .finalStatus , tt .finalStatusText , tt .skipReplyingOrgPublicMembers , tt . commitMessage )
615645 if tt .tektondir != "" {
616646 ghtesthelper .SetupGitTree (t , mux , tt .tektondir , & tt .runevent , false )
617647 }
@@ -738,6 +768,8 @@ func TestRun(t *testing.T) {
738768 logURL , ok := pr .Annotations [path .Join (apipac .GroupName , "log-url" )]
739769 assert .Assert (t , ok , "failed to find log-url label on pipelinerun: %s/%s" , pr .GetNamespace (), pr .GetGenerateName ())
740770 assert .Equal (t , logURL , cs .Clients .ConsoleUI ().DetailURL (& pr ))
771+ assert .Equal (t , pr .Labels [keys .SHA ], tt .runevent .SHA , "sha label mismatch on pipelinerun %s" , pr .GetName ())
772+ assert .Equal (t , provider .SkipCI (tt .commitMessage ), tt .runevent .HasSkipCommand , "HasSkipCommand mismatch for commit message %q" , tt .commitMessage )
741773
742774 if pacInfo .SecretAutoCreation {
743775 secretName , ok := pr .GetAnnotations ()[keys .GitAuthSecret ]
0 commit comments