Skip to content

Make the Mintlify trigger reliable - #161

Open
roh26it wants to merge 2 commits into
masterfrom
ci/mintlify-trigger-reliability
Open

roh26it wants to merge 2 commits into
masterfrom
ci/mintlify-trigger-reliability

Conversation

@roh26it

@roh26it roh26it commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The Mintlify trigger ran on every merge and always passed, but docs often did not update. This PR fixes the two causes in this repo.

Problem Fix
The job called Mintlify about 5 s after the push. raw.githubusercontent.com sends cache-control: max-age=300, so the build could fetch a stale openapi.yaml. Wait 310 s after a push. Then fail if the raw URL does not match openapi.yaml at the pushed commit.
curl ignored HTTP errors, and the job never checked the result. A bad token or a failed build still passed. Use --fail-with-body, require a statusId, then poll GET /v1/project/update-status/{statusId} until success or failure. A failure prints the Mintlify summary and logs.

Other changes:

  • The workflow has two jobs. wait-for-spec waits and checks the spec; a newer push cancels it, which is safe because nothing has gone to Mintlify yet. deploy triggers and polls; it queues and is never cancelled, so each Mintlify build finishes before the next one starts.
  • workflow_dispatch lets you run the workflow by hand from the Actions tab. A manual run skips the wait. Both jobs run only on master, because the spec check always reads the master URL.
  • The workflow uses the existing MINTLIFY_TOKEN and MINTLIFY_PROJECT_ID secrets. No new secrets.

This PR does not make new endpoints appear. docs-core API pages are stubs, so each new endpoint also needs a stub page and a nav entry in docs-core (for example, Portkey-AI/docs-core#1098 for /decisions).

Test plan

  • Workflow YAML parses, and bash -n passes on each run script
  • The hash check matches today: git show origin/master:openapi.yaml and the raw URL have the same SHA-256
  • After merge, the run on master waits, triggers, and ends with Mintlify status: success
  • A manual workflow_dispatch run on master skips the wait; a run on another branch skips both jobs

🤖 Generated with Claude Code

The job called Mintlify about 5s after each push, but raw.githubusercontent.com caches the spec for 300s, so builds could use a stale spec. curl also ignored HTTP errors and the job never checked the deployment result, so failures showed green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 27, 2026 11:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Deployment ordering and manual-dispatch reliability issues remain unresolved.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Improves Mintlify documentation deployments by validating spec freshness and monitoring deployment status.

Changes:

  • Adds delayed spec validation and hash checks.
  • Polls Mintlify deployment results and reports failures.
  • Adds manual dispatch and concurrency controls.
File Summary
.github/​workflows/​mintlify-update.yml Updates the workflow for validated Mintlify deployments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/mintlify-update.yml Outdated
Comment thread .github/workflows/mintlify-update.yml
Cancelling a run after the POST left its Mintlify build running, so builds could finish out of order. Split the job: the wait job can be cancelled because it has no remote side effects, and the deploy job queues. Also restrict the workflow to master, because the spec check always reads the master URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 27, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The concurrency configuration can replace pending deployments, so it does not guarantee every merge is processed.

Review effort: Lite
Findings: None

Resolved since last review (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants