@@ -101,7 +101,8 @@ func newRepoAccessCache(client *githubv4.Client, restClient *github.Client, opts
101101 cache : cache2go .Cache (defaultRepoAccessCacheKey ),
102102 ttl : defaultRepoAccessTTL ,
103103 trustedBotLogins : map [string ]struct {}{
104- "copilot" : {},
104+ "copilot" : {},
105+ "github-actions[bot]" : {},
105106 },
106107 }
107108 for _ , opt := range opts {
@@ -133,6 +134,10 @@ type CacheStats struct {
133134// - the repository is private;
134135// - the content was created by the viewer.
135136func (c * RepoAccessCache ) IsSafeContent (ctx context.Context , username , owner , repo string ) (bool , error ) {
137+ if c .isTrustedBot (username ) {
138+ return true , nil
139+ }
140+
136141 repoInfo , err := c .getRepoAccessInfo (ctx , username , owner , repo )
137142 if err != nil {
138143 return false , err
@@ -141,7 +146,7 @@ func (c *RepoAccessCache) IsSafeContent(ctx context.Context, username, owner, re
141146 c .logDebug (ctx , fmt .Sprintf ("evaluated repo access for user %s to %s/%s for content filtering, result: hasPushAccess=%t, isPrivate=%t" ,
142147 username , owner , repo , repoInfo .HasPushAccess , repoInfo .IsPrivate ))
143148
144- if c . isTrustedBot ( username ) || repoInfo .IsPrivate || repoInfo .ViewerLogin == strings .ToLower (username ) {
149+ if repoInfo .IsPrivate || repoInfo .ViewerLogin == strings .ToLower (username ) {
145150 return true , nil
146151 }
147152 return repoInfo .HasPushAccess , nil
0 commit comments