push to main │ v holocron maintain │ v OpenCode updates MDX pages │ ├── no MDX changes ──> stop └── MDX files changed │ v branch holocron/maintain-<timestamp> │ v gh pr create into main
GITHUB_TOKEN on the Maintain step so OpenCode can push the new branch and open the pull request. Leave checkout credentials enabled. Do not set persist-credentials: false.holocron maintain with no args. GitHub writes the push payload to GITHUB_EVENT_PATH. Maintain reads before (the branch tip before this push) and after (the new tip, this checkout), then runs git diff before..after.HEAD~1.git push (one or more commits) │ v GITHUB_EVENT_PATH before = old tip of the branch after = new tip │ v git diff before..after │ v pages whose @/ sources sit in that diff
fetch-depth: 0 so those SHAs exist locally. A new-branch push has before all zeros. Maintain then uses git diff-tree --root on after.holocron/maintain-<timestamp> and opens one pull request into main. It never commits on main or on any other existing branch.12345678910111213141516171819202122name: Maintain documentation on: push: branches: [main] permissions: contents: write pull-requests: write id-token: write jobs: maintain: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - run: npx -y "@holocron.so/cli" maintain env: GITHUB_TOKEN: ${{ github.token }}
contents: write lets OpenCode create the maintain branch. pull-requests: write lets it open the pull request. id-token: write authenticates Holocron over OIDC.main with a ruleset that requires a pull request and does not let GitHub Actions bypass it. The token can still create holocron/maintain-* branches.1234567891011121314151617181920212223242526name: Weekly documentation review on: schedule: - cron: "0 9 * * 1" workflow_dispatch: permissions: contents: write pull-requests: write id-token: write jobs: maintain: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - run: | npx -y "@holocron.so/cli" maintain \ --all \ --prompt-file .holocron/prompts/weekly-review.md env: GITHUB_TOKEN: ${{ github.token }}
cancel-in-progress: true for push maintenance. A later push compares only its own before and after states, so cancelling the preceding run can leave its source changes unreviewed.--model provider/model and set that provider's env var. Holocron auth is not used. See the OpenCode providers page for the supported keys.git and gh, and it can read the environment.1234- run: npx -y "@holocron.so/cli" maintain --model anthropic/claude-sonnet-4-5 env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GITHUB_TOKEN: ${{ github.token }}
id-token: write when the Holocron-hosted model is not used. Keep contents: write and pull-requests: write so OpenCode can still open the pull request.