-
Notifications
You must be signed in to change notification settings - Fork 0
[CHORE] Migrate PRojection GHA/Workflow here for reusability #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
93fb001
Create overture-projection.yml
lowlydba 25f2155
Update overture-projection.yml
lowlydba bf4be5f
Update overture-projection.yml
lowlydba 9d485b1
Add Overture PRojection GitHub Action
lowlydba 341d89a
Update overture-projection.yml
lowlydba 664c74f
fix: reference composite action by full repo path for reusable workfl…
lowlydba cc965cb
fix: scope app token to omf-devex and target repo only, not all org r…
lowlydba 030d1cf
Update action.yml
lowlydba 203e2eb
overture-projection: CRLF fixes & workflow updates
lowlydba 4a9181a
Update action.yml
lowlydba 838b1be
Update overture-projection.yml
lowlydba af2f49b
Update action.yml
lowlydba 40140f4
Update overture-projection.yml
lowlydba 84b5eb5
Add concurrency, secure secrets, and permissions
lowlydba 4fb68a4
Update workflows: annotations, concurrency, checkout
lowlydba 53a9846
Update action.yml
lowlydba 3fad0e8
Update action.yml
lowlydba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| # Overture PRojection | ||
|
|
||
| Posts an AI-generated code review comment on a pull request. Skills drive what the model looks for — each skill is a `SKILL.md` file that provides focused review instructions for a particular concern. | ||
|
|
||
| Supports [GitHub Models](https://docs.github.com/en/github-models) (default) and [Anthropic](https://docs.anthropic.com/en/docs/about-claude/models) as model providers. | ||
|
|
||
| ## How it works | ||
|
|
||
| 1. **Load skills** — sparse-checkouts `omf-devex/skills/`, parses frontmatter, filters to `pr-reviewer` surface. Raw content is stored; nothing is fetched yet. | ||
| 2. **Fetch PR diff** — title, body, branch refs, closing issues (GraphQL), and changed file patches up to `max-diff-chars`. | ||
| 3. **Select skills** — a fast/cheap model reads skill descriptions and changed file paths, picks which optional skills apply, and logs its reasoning. `always-skills` bypass this step entirely. | ||
| 4. **Fetch context files** — only for selected skills; fetched in parallel via the GitHub App token, compressed, and capped per file at `max-context-file-chars` (defaults to 10% of the input token budget). | ||
| 5. **Post review** — builds system prompt from selected skills + context, trims the diff to the remaining token budget, calls the review model, and posts or updates a PR comment. | ||
|
|
||
| ## Recipes | ||
|
|
||
| ### GitHub Copilot (default) | ||
|
|
||
| No extra secrets needed beyond the standard workflow token. | ||
|
|
||
| ```yaml | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: read | ||
| models: read | ||
|
|
||
| steps: | ||
| - uses: OvertureMaps/workflows/.github/actions/overture-projection@030d1cf86ff0013daa6f41ba0073cf048ec2d494 # reusable-PRojection-workflow | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| app-private-key: ${{ secrets.OVERTURE_PROJECTION_APP_PEM }} | ||
| ``` | ||
|
|
||
| **Automatic defaults** (GitHub Models gpt-4.1, 8,000 token context window): | ||
|
|
||
| | Input | Auto default | | ||
| | --- | --- | | ||
| | `model` | `gpt-4.1` | | ||
| | `selection-model` | `gpt-4.1-mini` | | ||
| | `max-input-tokens` | `6200` (= 8,000 − 1 500 output − 300 margin) | | ||
| | `max-output-tokens` | `1500` | | ||
|
|
||
| ### Anthropic | ||
|
|
||
| Add `ANTHROPIC_API_KEY` as a repo or org secret. All current Claude models have a 200k token context window. | ||
|
|
||
| ```yaml | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: read | ||
|
|
||
| steps: | ||
| - uses: OvertureMaps/workflows/.github/actions/overture-projection@030d1cf86ff0013daa6f41ba0073cf048ec2d494 # reusable-PRojection-workflow | ||
| with: | ||
| model-provider: anthropic | ||
| model: claude-opus-4-6 | ||
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| app-private-key: ${{ secrets.OVERTURE_PROJECTION_APP_PEM }} | ||
| ``` | ||
|
|
||
| Token limits (`max-input-tokens`, `max-output-tokens`) default automatically to the right values for the provider — you only need to set them if you're using a model with a non-standard context window. | ||
|
|
||
| **Automatic defaults** (Anthropic 200k context window): | ||
|
|
||
| | Input | Auto default | | ||
| | --- | --- | | ||
| | `model` | `claude-opus-4-6` | | ||
| | `selection-model` | `claude-haiku-4-6` | | ||
| | `max-input-tokens` | `190000` (= 200k − 4,096 output − ~6,000 margin) | | ||
| | `max-output-tokens` | `4096` | | ||
|
|
||
| Note: `models: read` permission is not required when using Anthropic. | ||
|
|
||
| ## Inputs | ||
|
|
||
| ### Provider | ||
|
|
||
| | Input | Default | Description | | ||
| | --- | --- | --- | | ||
| | `model-provider` | `github-models` | `github-models` or `anthropic` | | ||
| | `model` | _(default)_ | Model ID for the review. Defaults to `gpt-4.1` (github-models) or `claude-opus-4-6` (anthropic) | | ||
| | `selection-model` | _(default)_ | Model ID for skill selection. Defaults to `gpt-4.1-mini` (github-models) or `claude-haiku-4-6` (anthropic) | | ||
| | `max-input-tokens` | _(default)_ | Max input tokens. Defaults to `6200` (github-models) or `190000` (anthropic). Override only for non-standard context windows | | ||
| | `max-output-tokens` | _(default)_ | Max tokens the model may generate. Defaults to `1500` (github-models) or `4096` (anthropic) | | ||
| | `github-token` | `github.token` | Token with `pull-requests:write`, `models:read`, and read access to `omf-devex`. Not used for model calls when `model-provider` is `anthropic` | | ||
| | `anthropic-api-key` | _(empty)_ | Anthropic API key. Required when `model-provider` is `anthropic` | | ||
|
|
||
| ### Auth | ||
|
|
||
| | Input | Default | Description | | ||
| | --- | --- | --- | | ||
| | `app-id` | `Iv23liBMB2dC9UQJ5pHL` | Overture PRojection GitHub App Client ID | | ||
| | `app-private-key` | _(empty)_ | GitHub App private key (`secrets.OVERTURE_PROJECTION_APP_PEM`). Used to generate an installation token for cross-repo context file reads. Falls back to `github-token` if omitted | | ||
|
|
||
| ### Behaviour | ||
|
|
||
| | Input | Default | Description | | ||
| | --- | --- | --- | | ||
| | `always-skills` | `pr-review` | Comma-separated skill names included on every run, bypassing model selection | | ||
| | `devex-ref` | `main` | Git ref of `omf-devex` to load skills from | | ||
| | `max-files` | `20` | Maximum number of changed files to fetch from the GitHub API | | ||
| | `max-diff-chars` | `100000` | Fetch ceiling for diff content. The actual amount sent to the model is computed dynamically based on the remaining token budget after skills and metadata | | ||
| | `max-context-file-chars` | _(default)_ | Hard cap per individual skill context file (the cross-repo files declared via `context-files:` in skill frontmatter — not the overall prompt context). Defaults to 10% of the input token budget (~2 500 chars for github-models, ~76 000 for anthropic). Set this to enforce a tighter ceiling regardless of token budget | | ||
| | `comment-mode` | `update` | `update` edits the existing comment in place; `new` posts a fresh PR review each run | | ||
| | `comment-tag` | `overture-projection` | Hidden HTML marker used to identify the managed comment in `update` mode | | ||
| | `pr-number` | _(event)_ | PR number to review. Required for `workflow_dispatch` triggers | | ||
| | `repository` | _(current repo)_ | Target repository in `owner/repo` format | | ||
| | `dry-run` | `false` | Print the review body to the log without posting it | | ||
|
|
||
| ## Token budget | ||
|
|
||
| The action computes the diff budget dynamically at review time: | ||
|
|
||
| ``` | ||
| diff budget = (max-input-tokens × 4 chars/token) − system prompt chars − user prompt preamble chars | ||
| ``` | ||
|
|
||
| Files are included whole (never truncated mid-diff); once the budget is exhausted, remaining files are listed in the review with a recommendation to split the PR. | ||
|
|
||
| `max-input-tokens` and `max-output-tokens` default automatically based on the provider (see `scripts/lib/defaults.js`). You only need to set them explicitly when using a model with a non-standard context window: | ||
|
|
||
| | Provider | `max-input-tokens` | `max-output-tokens` | Basis | | ||
| | --- | --- | --- | --- | | ||
| | `github-models` | `6200` | `1500` | 8,000 context − 1,500 output − 300 margin | | ||
| | `anthropic` | `190000` | `4096` | 200k context − 4,096 output − ~6,000 margin | | ||
|
|
||
| ## Skills | ||
|
|
||
| Skills live in `omf-devex/skills/<name>/SKILL.md`. The folder name is the skill ID — it must match the `name` frontmatter field and is what you pass to `always-skills`. | ||
|
|
||
| Only skills with `surfaces: [pr-reviewer]` (or no `surfaces` field) are loaded. Skills tagged `surfaces: [agent]` are filtered out before the selection model sees them. | ||
|
|
||
| - `always-skills` bypass selection and are always included in the system prompt. | ||
| - All other `pr-reviewer` skills are passed to the selection model with their `description`; the model picks which are relevant to the PR. | ||
| - `context-files` are fetched after selection, so only selected skills pay the network cost. | ||
|
|
||
| For full frontmatter field reference and authoring guidance see the [omf-devex README](../../../../README.md#skills). | ||
|
|
||
| ## Required workflow permissions | ||
|
|
||
| ```yaml | ||
| permissions: | ||
| contents: read # checkout | ||
| pull-requests: write # post/update review comment | ||
| issues: read # closingIssuesReferences GraphQL query | ||
| models: read # GitHub Models API (not needed for anthropic provider) | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.