Add opt-in multi-repository auditing#176
Open
mrfelton wants to merge 2 commits into
Open
Conversation
Add opt-in multi-repository support to the audit and optimizer workflows. When `.github/agentic-ops.yml` lists `repos:`, both workflows collect each repository's agentic-workflow logs and aggregate AI-credit spend per repository and per workflow, so one central repository can monitor an entire org's agentic workflows. - New `.github/agentic-ops.yml` config (`repos:` + optional `source-repo:`). - For the current repository, agentic workflows are resolved from the local checkout by tracker-id (unchanged single-repo behavior). For every other repository they are resolved by display name via the GitHub Actions API and queried with `gh aw logs --repo`, because gh aw logs resolves a remote workflow only by its name. Runs are stamped with their source repository and de-duplicated on (repository, run_id). - Audit groups and reports per repository; optimizer selects, analyzes, and reads the target workflow's source from its own repository. - The hardcoded `githubnext/agentic-ops` family-exclusion is now driven by a configurable `source-repo` (defaults to githubnext/agentic-ops). - Cross-repo reads use gh-aw's standard GH_AW_GITHUB_TOKEN magic secret (a token with actions: read on the listed repos), falling back to GITHUB_TOKEN. With no config file present, behavior is unchanged: each workflow audits only the repository it runs in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The README declares the project MIT-licensed but no LICENSE file existed. Add the standard MIT license text. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b948639 to
3d8dd3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds opt-in multi-repository auditing to the audit and optimizer workflows. Today both audit only the repository they run in; this lets one central repository monitor AI-credit (AIC) spend across many repositories.
When a new
.github/agentic-ops.ymlconfig listsrepos:, both workflows collect each repository's agentic-workflow logs and aggregate AIC spend per repository and per workflow. With no config file present, behavior is unchanged — each workflow audits only the repository it runs in (fully backward compatible).How it works
.github/agentic-ops.yml: arepos:list (owner/repo) plus an optionalsource-repo:(defaults togithubnext/agentic-ops).tracker-id(unchanged). For every other repository they are resolved by display name via the GitHub Actions API, then queried withgh aw logs "<name>" --repo <owner/repo>— becausegh aw logsresolves a remote workflow only by its display name (a remotetracker-id/lock-filename lookup returns nothing). Runs are stamped with their sourcerepositoryand de-duplicated on(repository, run_id)— run IDs are only unique per repo, so the previousunique_by(.run_id)could collide same-numbered runs across repos.[repository, workflow_name], so identically named workflows in different repos are never conflated. The audit report gains an optional per-repository rollup, and run links use each run's ownurl.githubnext/agentic-opsfamily-exclusion (in three places) is now driven by the configurablesource-repo.actions: readon the listed repos. The workflows use gh-aw's standardGH_AW_GITHUB_TOKEN"magic" secret (auth reference), falling back toGITHUB_TOKEN(current repo only) when unset. No bundle-specific secret is introduced.Security review (per gh-aw strict mode)
GH_AW_GITHUB_TOKENmagic secret — read-only here (actions: read; collection only, never exposed to the agent), falling back toGITHUB_TOKEN. No new bundle-specific secret.Also
LICENSEfile (separate commit) — the README declares MIT but noLICENSEexisted. Happy to split this into its own PR if you prefer.Testing
--reporeturns nothing remotely).gh aw compile(v0.79.6): 0 errors / 0 warnings; actionlint + shellcheck clean for the changed shell.Lock files compiled with gh-aw v0.79.6.
🤖 Generated with Claude Code