Skip to content

Commit

Permalink
Fix GitHub Action ACL owner repo wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
kiootic committed Nov 2, 2023
1 parent 2c4deda commit dddba87
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/models/credential_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ func (c CredentialID) Matches(r *config.ACLSubjectRule) bool {
case CredentialIDKindGitHubUser:
return r.GitHubUser != "" && r.GitHubUser == data
case CredentialIDGitHubRepositoryActions:
return r.GitHubRepositoryActions != "" &&
(r.GitHubRepositoryActions == data ||
r.GitHubRepositoryActions == "*")
if r.GitHubRepositoryActions == "*" || r.GitHubRepositoryActions == data {
return true
}

repoOwner, _, ok := strings.Cut(data, "/")
return ok && r.GitHubRepositoryActions == repoOwner+"/*"
case CredentialIDIP:
if r.IpRange == "" {
return false
Expand Down

0 comments on commit dddba87

Please sign in to comment.