Auto-merge OpenAPI description update PRs - #6993
Draft
shawnHartsell wants to merge 7 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds automation to merge current bot-generated OpenAPI updates and close superseded PRs.
Changes:
- Selects and validates the latest OpenAPI 3.0/3.1 PRs.
- Scans for potential breaking changes before merging.
- Pushes merges, closes older PRs, and sends failure alerts.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/auto-merge-openapi-updates.yml |
Implements the scheduled auto-merge workflow. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 7
- Review effort level: Balanced
Comment on lines
+99
to
+103
| code=$(curl --silent --output /dev/null --write-out '%{http_code}' \ | ||
| --max-time 20 \ | ||
| -u "${CHATTERBOX_TOKEN}:" \ | ||
| "${CHATTERBOX_URL%/}/topics/%23api-platform" \ | ||
| --data ':white_check_mark: OpenAPI auto-merge preflight: chatterbox route is alive.' \ |
Comment on lines
+169
to
+173
| superseded=$(jq -r \ | ||
| --argjson keep30 "${pr_30:-0}" \ | ||
| --argjson keep31 "${pr_31:-0}" \ | ||
| '[.[].number | select(. != $keep30 and . != $keep31)] | join(" ")' \ | ||
| <<<"$open_prs") |
| # Removed top-level path key, e.g. ` "/repos/{owner}/{repo}":` | ||
| paths=$(count '^- "/') | ||
| # Removed enum member, e.g. ` - archived` | ||
| enums=$(count '^-[[:space:]]+- [A-Za-z0-9_.-]+$') |
| [ -n "$ref" ] || continue | ||
|
|
||
| git fetch --no-tags --filter=blob:none origin "$ref":"refs/remotes/origin/$ref" | ||
| diff=$(git diff "$base...origin/$ref" -- "$file" || true) |
| for pair in "$PR_30:$REF_30" "$PR_31:$REF_31"; do | ||
| pr="${pair%%:*}"; ref="${pair#*:}" | ||
| [ -n "$pr" ] && [ -n "$ref" ] || continue | ||
| git fetch --no-tags origin "$ref":"refs/remotes/origin/$ref" --filter=blob:none |
Comment on lines
+328
to
+330
| if: >- | ||
| steps.preflight.outcome == 'success' && | ||
| (failure() || steps.breaking.outputs.status == 'breaking') |
Comment on lines
+25
to
+27
| permissions: | ||
| contents: write | ||
| pull-requests: write |
shawnHartsell
marked this pull request as draft
August 14, 2026 16:40
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
Adds
.github/workflows/auto-merge-openapi-updates.ymlto continuously process machine-generated OpenAPI description updates. It keeps the newest 3.0 and 3.1 update PRs moving while preserving lint, compatibility, and release-note safeguards.How it works
Runs every two hours, with
workflow_dispatchavailable for a dry run:github-openapi-botPR for each OpenAPI version.ghes-*description version that is not yet on the default branch, or when an openmerge-freezeissue exists.The workflow writes a step summary when it holds or fails so the exception is visible in the Actions run without requiring any external service integration.
Design notes
These generated PRs are too large for reliable use of the merge API, so the workflow uses a blobless checkout and a normal Git merge. The checkout avoids downloading the repository's full history and fetches content lazily as needed.
The workflow uses only the repository's standard
GITHUB_TOKEN.The compatibility scanner parses both descriptions instead of relying on removed diff lines. This matters because adding a required request field is breaking, while removing a response guarantee is breaking in the opposite direction.
Validation
Rollout
Run
workflow_dispatchwithdry_run: trueafter enabling the workflow to confirm candidate selection before allowing merges.Note
Left as a draft for review.