feat: auto-merge safe Renovate PRs via CI (#277) #284

Merged
guettlibot merged 1 commits from issue-277-fix into main 2026-05-27 07:37:17 +00:00
guettlibot commented 2026-05-27 07:36:49 +00:00 (Migrated from codeberg.org)

Summary

  • Add packageRules to renovate.json so Renovate labels patch/minor/pin/digest/lockFileMaintenance PRs with automerge; major-version updates get no such label and remain for manual review.
  • Add merge-renovate job to .forgejo/workflows/ci.yml that runs after the check job succeeds on any renovate/* branch, fetches the PR's labels, and merges via the Forgejo API only when the automerge label is present.

How it works

  1. Renovate runs daily and creates a PR for a dependency update.
  2. CI's check job runs the full test suite.
  3. If check passes and the PR is on a renovate/* branch, merge-renovate fires.
  4. It calls the Forgejo API to read the PR's labels; if automerge is present (patch/minor/lockfile update), it merges. If not (major update), it skips and leaves the PR for human review.

Test plan

  • Confirm renovate.json is valid JSON and the schema validates.
  • Verify a future Renovate patch/minor PR receives both dependencies and automerge labels.
  • Verify merge-renovate job is skipped on non-Renovate PRs and on push events.
  • Verify a Renovate PR with automerge label is merged after CI passes.

🤖 Generated with Claude Code

## Summary - Add `packageRules` to `renovate.json` so Renovate labels patch/minor/pin/digest/lockFileMaintenance PRs with `automerge`; major-version updates get no such label and remain for manual review. - Add `merge-renovate` job to `.forgejo/workflows/ci.yml` that runs after the `check` job succeeds on any `renovate/*` branch, fetches the PR's labels, and merges via the Forgejo API only when the `automerge` label is present. ## How it works 1. Renovate runs daily and creates a PR for a dependency update. 2. CI's `check` job runs the full test suite. 3. If `check` passes and the PR is on a `renovate/*` branch, `merge-renovate` fires. 4. It calls the Forgejo API to read the PR's labels; if `automerge` is present (patch/minor/lockfile update), it merges. If not (major update), it skips and leaves the PR for human review. ## Test plan - [ ] Confirm `renovate.json` is valid JSON and the schema validates. - [ ] Verify a future Renovate patch/minor PR receives both `dependencies` and `automerge` labels. - [ ] Verify `merge-renovate` job is skipped on non-Renovate PRs and on `push` events. - [ ] Verify a Renovate PR with `automerge` label is merged after CI passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.