Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Main branch policy

- All changes to `main` must go through a pull request, including the owner's changes.
- Only @viralcodex can merge. Direct pushes, force pushes, and branch deletion are blocked.
- PRs authored by @viralcodex need no reviews.
- Other PRs require @viralcodex to approve the current head commit. New commits, dismissed approvals, and requested changes block merging.
- The `Owner approval` status is mandatory and has no ruleset bypass.

The privileged approval workflow uses code from `main`, never contributor code. A permissionless review-event workflow wakes it after reviews. A scheduled reconciliation also handles reviews if a fork's event workflow cannot run. GitHub may delay scheduled runs. To refresh immediately, run **Enforce owner approval** from the Actions tab or post a PR comment.

Commit statuses are shared across PRs with the same head commit. All such open PRs must satisfy the policy to prevent one PR from bypassing another's approval requirement.

Accept untrusted contributions from forks without granting repository write access. This policy trusts the GitHub Actions app to publish the approval status. Repository writers can author Actions workflows and must be trusted.

Run the policy tests with `node --test .github/scripts/owner-approval.test.cjs`.
4 changes: 2 additions & 2 deletions .github/workflows/owner-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
timeout-minutes: 5
steps:
# Always use trusted main, never a PR's code or merge commit.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
ref: refs/heads/main
persist-credentials: false
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const { reconcile } = require('./.github/scripts/owner-approval.cjs')
Expand Down
Loading