Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions pkg/workflow/safe_update_enforcement.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,6 @@ var ghAwActionPrefixes = []string{
"github/gh-aw-actions/",
}

// runtimeActionRepos is the set of action repos used by the runtime manager.
// These are populated from knownRuntimes at init time so the trusted-action
// list stays in sync with runtime_definitions.go automatically.
var runtimeActionRepos map[string]bool

func init() {
runtimeActionRepos = make(map[string]bool, len(knownRuntimes))
for _, rt := range knownRuntimes {
if rt.ActionRepo != "" {
runtimeActionRepos[rt.ActionRepo] = true
}
}
}

// isTrustedActionRepo reports whether a repo string belongs to a trusted org or project.
// Trusted repos include the "actions/" GitHub org, gh-aw's own infrastructure actions,
// and actions used by the runtime manager (e.g. ruby/setup-ruby, oven-sh/setup-bun).
Expand All @@ -156,7 +142,8 @@ func isTrustedActionRepo(repo string) bool {
return true
}
}
return runtimeActionRepos[repo]
_, ok := actionRepoToRuntime[repo]
return ok
Comment on lines +145 to +146
}

// collectActionViolations compares the new action refs against the previous manifest
Expand Down
Loading