@@ -136,10 +136,11 @@ is that what you want? make sure you use -n when generating the secret, eg: echo
136136 // trigger CI on the repository, as any user is able to comment on a pushed commit in open-source repositories.
137137 if p .event .TriggerTarget == triggertype .Push && opscomments .IsAnyOpsEventType (p .event .EventType ) {
138138 status := provider.StatusOpts {
139- Status : CompletedStatus ,
140- Title : "Permission denied" ,
141- Conclusion : failureConclusion ,
142- DetailsURL : p .event .URL ,
139+ Status : CompletedStatus ,
140+ Title : "Permission denied" ,
141+ Conclusion : failureConclusion ,
142+ DetailsURL : p .event .URL ,
143+ AccessDenied : true ,
143144 }
144145 if allowed , err := p .checkAccessOrErrror (ctx , repo , status , "by GitOps comment on push commit" ); ! allowed {
145146 return nil , err
@@ -151,10 +152,11 @@ is that what you want? make sure you use -n when generating the secret, eg: echo
151152 // on comment we skip it for now, we are going to check later on
152153 if p .event .TriggerTarget != triggertype .Push && p .event .EventType != opscomments .NoOpsCommentEventType .String () {
153154 status := provider.StatusOpts {
154- Status : queuedStatus ,
155- Title : "Pending approval, waiting for an /ok-to-test" ,
156- Conclusion : pendingConclusion ,
157- DetailsURL : p .event .URL ,
155+ Status : queuedStatus ,
156+ Title : "Pending approval, waiting for an /ok-to-test" ,
157+ Conclusion : pendingConclusion ,
158+ DetailsURL : p .event .URL ,
159+ AccessDenied : true ,
158160 }
159161 if allowed , err := p .checkAccessOrErrror (ctx , repo , status , "via " + p .event .TriggerTarget .String ()); ! allowed {
160162 return nil , err
@@ -266,10 +268,11 @@ func (p *PacRun) getPipelineRunsFromRepo(ctx context.Context, repo *v1alpha1.Rep
266268 // we skipped previously so we can get the match from the event to the pipelineruns
267269 if p .event .EventType == opscomments .NoOpsCommentEventType .String () || p .event .EventType == opscomments .OnCommentEventType .String () {
268270 status := provider.StatusOpts {
269- Status : queuedStatus ,
270- Title : "Pending approval, waiting for an /ok-to-test" ,
271- Conclusion : pendingConclusion ,
272- DetailsURL : p .event .URL ,
271+ Status : queuedStatus ,
272+ Title : "Pending approval, waiting for an /ok-to-test" ,
273+ Conclusion : pendingConclusion ,
274+ DetailsURL : p .event .URL ,
275+ AccessDenied : true ,
273276 }
274277 if allowed , err := p .checkAccessOrErrror (ctx , repo , status , "by GitOps comment on push commit" ); ! allowed {
275278 return nil , err
@@ -410,6 +413,7 @@ func (p *PacRun) checkAccessOrErrror(ctx context.Context, repo *v1alpha1.Reposit
410413 }
411414 p .eventEmitter .EmitMessage (repo , zap .InfoLevel , "RepositoryPermissionDenied" , msg )
412415 status .Text = msg
416+
413417 if err := p .vcx .CreateStatus (ctx , p .event , status ); err != nil {
414418 return false , fmt .Errorf ("failed to run create status, user is not allowed to run the CI:: %w" , err )
415419 }
0 commit comments