@@ -89,27 +89,28 @@ is that what you want? make sure you use -n when generating the secret, eg: echo
8989 }
9090
9191 // Check if the submitter is allowed to run this.
92- allowed , err := p .vcx .IsAllowed (ctx , p .event )
93- if err != nil {
94- return nil , nil , err
95- }
96-
97- if ! allowed {
98- msg := fmt .Sprintf ("User %s is not allowed to run CI on this repo." , p .event .Sender )
99- p .logger .Info (msg )
100- if p .event .AccountID != "" {
101- msg = fmt .Sprintf ("User: %s AccountID: %s is not allowed to run CI on this repo." , p .event .Sender , p .event .AccountID )
102- }
103- status := provider.StatusOpts {
104- Status : "completed" ,
105- Conclusion : "skipped" ,
106- Text : msg ,
107- DetailsURL : "https://tenor.com/search/police-cat-gifs" ,
92+ if p .event .EventType != "push" {
93+ allowed , err := p .vcx .IsAllowed (ctx , p .event )
94+ if err != nil {
95+ return nil , nil , err
10896 }
109- if err := p .vcx .CreateStatus (ctx , p .event , p .run .Info .Pac , status ); err != nil {
110- return nil , nil , fmt .Errorf ("failed to run create status, user is not allowed to run: %w" , err )
97+ if ! allowed {
98+ msg := fmt .Sprintf ("User %s is not allowed to run CI on this repo." , p .event .Sender )
99+ p .logger .Info (msg )
100+ if p .event .AccountID != "" {
101+ msg = fmt .Sprintf ("User: %s AccountID: %s is not allowed to run CI on this repo." , p .event .Sender , p .event .AccountID )
102+ }
103+ status := provider.StatusOpts {
104+ Status : "completed" ,
105+ Conclusion : "skipped" ,
106+ Text : msg ,
107+ DetailsURL : "https://tenor.com/search/police-cat-gifs" ,
108+ }
109+ if err := p .vcx .CreateStatus (ctx , p .event , p .run .Info .Pac , status ); err != nil {
110+ return nil , nil , fmt .Errorf ("failed to run create status, user is not allowed to run: %w" , err )
111+ }
112+ return nil , nil , nil
111113 }
112- return nil , nil , nil
113114 }
114115
115116 rawTemplates := p .getAllPipelineRuns (ctx )
@@ -146,7 +147,6 @@ is that what you want? make sure you use -n when generating the secret, eg: echo
146147 if err != nil {
147148 return nil , nil , err
148149 }
149-
150150 // Match the PipelineRun with annotation
151151 matchedPRs , err := matcher .MatchPipelinerunByAnnotation (ctx , p .logger , pipelineRuns , p .run , p .event )
152152 if err != nil {
0 commit comments