Skip to content

ci: request reindex when frontmatter changes#2378

Closed
blakecduncan wants to merge 1 commit intomainfrom
blake/revalidate-frontmatter-reindex
Closed

ci: request reindex when frontmatter changes#2378
blakecduncan wants to merge 1 commit intomainfrom
blake/revalidate-frontmatter-reindex

Conversation

@blakecduncan
Copy link
Collaborator

@blakecduncan blakecduncan commented Mar 4, 2026

Description

Update SDK docs markdown revalidation workflow to notify docs-site when frontmatter changes so index rebuilds happen for slug/navigation-affecting updates.

Summary

  • Detect frontmatter diffs across changed docs/pages/**/*.md(x) files
  • Pass frontmatterChanged: true to /docs/api/revalidate/markdown once per workflow run
  • Keep batched markdown revalidation while preventing duplicate reindex dispatches
  • Fail workflow when reindex is requested but not successfully triggered

Test Plan

  • Validate workflow shell logic and payload gating for frontmatter changed vs unchanged
  • Confirm only first batch can include frontmatterChanged: true
  • Run end-to-end in GitHub Actions on a frontmatter-only SDK docs change
  • Run end-to-end in GitHub Actions on markdown content-only SDK docs change

LINEAR TASK: https://linear.app/alchemy/issue/DX-2383/reindex-on-frontmatter-change

Made with Cursor


PR-Codex overview

This PR enhances the GitHub Actions workflow in .github/workflows/revalidate-sdk-content.yml by adding checks for frontmatter changes in Markdown files. It updates the output to reflect whether frontmatter has changed and adjusts the API call payload accordingly.

Detailed summary

  • Added a check for frontmatter changes in Markdown files.
  • Introduced extract_frontmatter function to extract frontmatter from files.
  • Updated output variables to include frontmatterChanged.
  • Modified API payload to include frontmatter change status.
  • Implemented logic to trigger reindexing if frontmatter has changed.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Detect frontmatter diffs in changed docs pages and send frontmatterChanged
to markdown revalidation once per run. Fail the workflow when reindex was
requested but not successfully triggered.

Made-with: Cursor
@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aa-sdk-ui-demo Ready Ready Preview, Comment Mar 4, 2026 10:23pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the docs markdown revalidation GitHub Actions workflow to detect frontmatter changes and request a docs-site reindex when navigation/slug-affecting metadata changes.

Changes:

  • Detects frontmatter diffs across changed docs/pages/**/*.md(x) files during the workflow run.
  • Sends frontmatterChanged: true only once (in the first revalidation batch) to avoid duplicate reindex requests.
  • Fails the workflow when a frontmatter-driven reindex is requested but not acknowledged as triggered by the API response.

Comment on lines 42 to 45
echo "No MDX files changed in /docs/pages/ directory"
echo "filePaths=[]" >> $GITHUB_OUTPUT
echo "frontmatterChanged=false" >> $GITHUB_OUTPUT
exit 0
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Redirects to $GITHUB_OUTPUT should be quoted (e.g., >> "$GITHUB_OUTPUT") to avoid edge cases if the path contains spaces or special characters. This is the pattern recommended by GitHub Actions docs and makes the step more robust.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +86
echo "frontmatterChanged: $FRONTMATTER_CHANGED"
echo "filePaths=$FILE_PATHS_JSON" >> $GITHUB_OUTPUT
echo "frontmatterChanged=$FRONTMATTER_CHANGED" >> $GITHUB_OUTPUT
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Quote $GITHUB_OUTPUT in these output writes (e.g., >> "$GITHUB_OUTPUT") for robustness and to match GitHub Actions recommendations.

Copilot uses AI. Check for mistakes.
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