php-devops/.github/workflows/fork-pr-analysis.yml
Snider c03c49a539 ci: add fork-based compute workflows
Strategy: Heavy analysis runs on contributor's GitHub Actions allowance
Microsoft/GitHub subsidizes the compute through free tiers

Workflows:
- contributor-ci.yml: Full CI runs on fork (contributor pays)
- fork-ai-triage.yml: AI analysis, labeling, security scan (fork pays)
- fork-pr-analysis.yml: Upstream just verifies fork CI passed

Benefits:
- Unlimited scale via contributor free tiers
- AI/Copilot features use their allowance
- We only pay for lightweight verification
- Forks inherit these workflows automatically

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 22:27:08 +00:00

37 lines
1.3 KiB
YAML

name: PR Analysis (Fork)
# This workflow runs on the FORK's resources, not ours
# Contributors get free GitHub Actions minutes
# Microsoft/GitHub subsidizes the compute
on:
pull_request_target:
types: [opened, synchronize]
jobs:
# Lightweight check on our side - just verify the fork did the work
verify-fork-ci:
runs-on: ubuntu-latest
steps:
- name: Check fork CI status
uses: actions/github-script@v7
with:
script: |
const { data: checks } = await github.rest.checks.listForRef({
owner: context.payload.pull_request.head.repo.owner.login,
repo: context.payload.pull_request.head.repo.name,
ref: context.payload.pull_request.head.sha
});
const passed = checks.check_runs.filter(c => c.conclusion === 'success');
const failed = checks.check_runs.filter(c => c.conclusion === 'failure');
console.log(`Fork CI: ${passed.length} passed, ${failed.length} failed`);
if (failed.length > 0) {
core.setFailed('Fork CI has failures - contributor must fix on their fork');
}
---
# This file goes in the TEMPLATE so forks inherit it
# The heavy work runs on contributor's GitHub Actions allowance