Add release automation and Renovate auto-merge - #178
Open
aponcedeleonch wants to merge 3 commits into
Open
Conversation
Contributor
|
@aponcedeleonch could you rebase so we get the grype fix? |
Mirrors toolhive's releaseo-driven release flow, adapted for toolhive-core (VERSION-only bumps, no Helm chart steps), and turns on Renovate auto-merge gated on green required checks. First upstream hop of the CVE remediation cascade (stacklok-enterprise-platform#2190). - VERSION: seed to 0.0.26 (current latest tag) - renovate.json: automerge + platformAutomerge, minimumReleaseAge 0, add the `automerge` approver-app label - create-release-pr.yml: manual patch/minor/major release PR (VERSION only) - create-release-tag.yml: tag + Release on VERSION change to main - release-check.yml: daily, idempotent single release PR, classifies dependency-only vs functional and gates functional on a human Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The repo ruleset requires 1 approval, so Renovate's own auto-merge can never complete (a bot can't approve its own PR). Drop the auto-merge behavior from renovate.json and add an approve-automerge workflow that supplies the approval from a separate app identity. - renovate.json: remove automerge/automergeType/platformAutomerge; keep the `automerge` label + minimumReleaseAge 0 - approve-automerge.yml: on CI workflow_run success, approve eligible bot PRs (automerge label + bot author, not the approver's own PR) once the head SHA's full check set is green, then enable GitHub auto-merge (squash) - release-check.yml: wording now refers to the approve-automerge workflow Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Gate eligibility on the PR being authored by Renovate (not just any bot), so the workflow never auto-approves human PRs, release PRs, or other bots' PRs. Update release-check wording: dependency-only release PRs now need a maintainer's approval (the approver only covers Renovate PRs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aponcedeleonch
force-pushed
the
release-automation-setup
branch
from
July 28, 2026 10:53
210c569 to
3f1037f
Compare
Member
Author
|
@jhrozek done! thanks for the heads up. For this to work we need 2 new github apps. Sorry, I dropped the ball and got distracted. I will try to put in some hours for getting this to work |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What and why
toolhive-core has no release automation today: tags are hand-pushed. This adds the releaseo-driven release flow that stacklok/toolhive already uses, adapted for toolhive-core, plus daily release-checks and auto-merge of Renovate dependency bumps gated on green CI.
This is the first upstream hop of the CVE remediation cascade tracked in stacklok/stacklok-enterprise-platform#2190 (
core → catalog → toolhive → registry-server → platform). The design (labels, classification rules, trust boundary) comes from that issue.How auto-merge works here
The repo ruleset requires 1 approval, so GitHub-native auto-merge (or Renovate's) can never complete on its own: a bot cannot approve its own PR. Instead:
automergelabel (from renovate.json).approve-automerge.ymlruns on CI completion and, for Renovate PRs whose checks are green, submits an approving review as a separate approver app identity, which satisfies the "require 1 approval" rule, then enables GitHub auto-merge.The approver is scoped to Renovate PRs only. It never approves human PRs, release PRs, or any other bot's PRs.
Files
VERSION(new)0.0.26, the current latest release tag. Single source of truth; releaseo reads and writes it.renovate.json(changed)automergelabel alongsidedependencies(the eligibility signal the approver checks) and setsminimumReleaseAge: "0".approve-automerge.yml..github/workflows/approve-automerge.yml(new)workflow_run(completed) for CI. On success and for a pull_request run, resolves the PR from the head SHA and approves it iff it is authored by Renovate, carriesautomerge, and the head SHA's full check set is green. Then enables GitHub auto-merge (squash). Uses a distinct approver app token so the approval counts toward the ruleset..github/workflows/create-release-pr.yml(new)workflow_dispatchwithbump_type(patch/minor/major, default patch), for the minor/major bumps that stay behind a human. Mirrors toolhive's version but strips all Helm chart / values / helm-docs steps; bumps onlyVERSION..github/workflows/create-release-tag.yml(new)maintouchingVERSION(a release PR merged). Verifies the commit came from a release PR (robust to squash and merge-commit), then creates the tag and GitHub Release together in onegh release create. That ordering matters because the existingrelease.ymltriggers onpush: tagsand runsgh release upload, which needs the Release to already exist.release.ymlis left untouched..github/workflows/release-check.yml(new)release/*PR if one exists and only creates a new one when none is open, so it never stacks.app/renovate) and carries thedependencieslabel. It lists merged PRs via the API rather than parsing commits, so squash vs merge-commit doesn't matter.automerge, enables GitHub auto-merge. Merges once checks are green and the release PR has one approving review (see note below).needs-human, no auto-merge, and the PR body lists which PRs tipped it functional.Note: release PRs need a human approval
Because the approver is scoped to Renovate PRs only, dependency-only release PRs have auto-merge enabled but still need one human approving review before they merge (required checks still gate them). Renovate dependency PRs are fully hands-off; the release PR that ships them is the one human checkpoint per release. If you'd prefer the approver to also cover release PRs (identified by the release-bot author +
automergelabel), that's a small change, say the word.Verification
actionlintpasses on all four new workflows.renovate-config-validatorpasses onrenovate.json.dependencies-> dependency-only; one human PR -> functional (and names it); bot PR missing the label -> functional; nothing-since-tag -> functional fail-safe.Out of scope, needs an admin (flagged, not done here)
Repo/org settings, not files, so not in this diff:
vars.RELEASE_APP_CLIENT_ID+secrets.RELEASE_APP_PRIVATE_KEY(release-bot app) must exist in toolhive-core. Without them the release workflows fail at the token step.vars.APPROVER_APP_CLIENT_ID+secrets.APPROVER_APP_PRIVATE_KEY(approver app) must exist. This app must be a DISTINCT identity from Renovate (a bot can't approve its own PR), with Pull requests: write + Contents: read.automerge/needs-humanlabels: the daily workflow creates them idempotently; Renovate appliesautomergefrom its config.Tracking issue: stacklok/stacklok-enterprise-platform#2190