Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview succeeded!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Updates the Vale GitHub Actions workflow to lint only Markdown/MDX files changed in a pull request (instead of scanning the entire repository), aiming to significantly reduce CI runtime.
Changes:
- Fetch full git history and compute changed
.md/.mdxfiles from the PR commit range. - Gate Node/Yarn/Vale steps behind a “skip” output when no markdown files changed.
- Pass the computed changed-file list to
errata-ai/vale-action@reviewdog.
.github/workflows/vale.yml
Outdated
| - name: Get changed files | ||
| id: changed | ||
| run: | | ||
| FILES=$(git diff --name-only --diff-filter=d ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- '*.md' '*.mdx' | tr '\n' ' ') |
There was a problem hiding this comment.
git diff is comparing ${{ github.event.pull_request.base.sha }} to ${{ github.event.pull_request.head.sha }} with a two-dot range. If the PR branch is behind the base branch, this will include changes that exist only on the base branch (not introduced by the PR), causing Vale to lint unrelated files and potentially report unrelated issues. Use a merge-base comparison (e.g., the three-dot range) so only changes introduced by the PR are included.
| FILES=$(git diff --name-only --diff-filter=d ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- '*.md' '*.mdx' | tr '\n' ' ') | |
| FILES=$(git diff --name-only --diff-filter=d ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} -- '*.md' '*.mdx' | tr '\n' ' ') |
.github/workflows/vale.yml
Outdated
| if: steps.changed.outputs.skip == 'false' | ||
| run: | | ||
| sudo apt-get install ripgrep | ||
| rg -l0 '\$\[[^\]]*\]' -g '*.mdx' -g '*.md' . | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' |
There was a problem hiding this comment.
The "Swap stuff" step still runs rg ... . across the whole repository. This can be a significant portion of the runtime and undermines the goal of limiting Vale CI to the PR diff. Consider restricting the search/replace to the changed markdown files list (and skipping entirely when that list is empty), rather than scanning ..
| rg -l0 '\$\[[^\]]*\]' -g '*.mdx' -g '*.md' . | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' | |
| FILES="${{ steps.changed.outputs.files }}" | |
| if [ -n "$FILES" ]; then | |
| rg -l0 '\$\[[^\]]*\]' -g '*.mdx' -g '*.md' -- $FILES | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' | |
| fi |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Summary
.md/.mdxfiles from the PR diff and passes only those to ValeTest plan
🤖 Generated with Claude Code