Repository navigation
ci(preview-checks): resolve preview URL from the deployment check-run and check API pages against the PR head - #805
Merged
Conversation
…-run Mintlify sometimes posts a second preview comment and keeps updating the first one. Picking the newest comment by creation time then polled a frozen "Building" comment until the step timed out (#446, #610, #669). Take the URL from the Mintlify Deployment check-run for the head commit, which names the preview it built. The comment fallback, still used when the site didn't change, now pages through all comments and takes the most recently updated one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e ref Mintlify builds the preview from the PR head, but the API page check read docs.json from the merge commit. A branch older than a generated API page on main then failed with 404s for pages it never had (the 5 usage pages on #449, #475, #506, #511). Read the expected pages from a worktree of the head commit. The script still runs from the merge checkout, since older heads don't have it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
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.
Affected Components
preview-checksworkflow)Fixes two false failures in Preview checks. Each fix is its own commit.
1. "Resolve preview URL" times out when Mintlify posts a duplicate preview comment
Mintlify sometimes posts a second
mintlify-preview-commentcomment and keeps updating the first one. The step picked the newest comment by creation time (| last), so it polled a comment frozen at🟡 Buildinguntil the ~21-minute timeout. This failed 5 runs on #446, #610 and #669. 13 PRs have such a duplicate.success, take the preview URL from theMintlify Deploymentcheck-run for$HEAD_SHA. Itsoutput.summarynames the preview it built, so the comment isn't needed.--paginate --slurp; it used to read only the first 30) and takesmax_by(.updated_at). The comment body has no SHA to match on.2. API page check expects pages the preview can't have
check-api-preview.mjsreaddocs.jsonfrom the merge commit (refs/pull/N/merge), but Mintlify builds the preview from the PR head. Branches older than c7282f8 (Oct 6) therefore failed with 404s on the 5api-reference/usage/*pages that only exist onmain. This hit #449, #475, #506 and #511.Not fixed here: the 23 status-page 404s right after a long-lived branch first merges c7282f8. Mintlify serves stale routes on the first preview build after pages switch from MDX to OpenAPI-generated pages at the same URLs, and the next build is fine. That's on Mintlify's side; no open PR is affected today.
Notes for the Reviewer
I ran the edited step scripts locally against real PRs (
main's timeout cut to 45s):main64a3f6f0b17c8c493497899fd430018eVerify step, run as written against the live #804 preview:
mainhead:Verified 28 schema-generated API pages.80542734:Verified 0 schema-generated API pages.(it used to expect all 28)actionlint is clean on both commits, and
node --test .github/scripts/*.test.mjspasses (15/15).Neither fix has run in Actions yet. This PR only touches
.github/, so Mintlify will likely skip its deployment, and this PR's own run will then skip the preview checks without testing either fix. The first docs PR after merge will run the check-run path (step log:Mintlify Deployment success — preview: …) and the new Verify step.🤖 Generated with Claude Code