Vercel Build Validation
This guide explains how to use our build validation script with Vercel's "Ignored Build Step" feature to ensure proper localization file updates.
Overview
When deploying to Vercel, it's important to ensure that all localization files are properly synchronized. We provide a build script that validates localization file changes and determines whether a deployment should proceed.
Using the Ignored Build Step
In your Vercel project settings, you can use our validation script in the "Ignored Build Step" field. This will prevent unnecessary builds when localization files aren't properly synchronized.
Set the following in the "Ignored Build Step" field:
Note: Make sure the script is in your repository's root directory or adjust the path accordingly.
Build Script
The build script (vercel-build.sh) checks if changes to the source localization file (en.json) are properly reflected in other locale files:
How It Works
The script follows Vercel's "Ignored Build Step" convention:
- Returns
exit 0: Skip the build (when validation fails or no changes detected) - Returns
exit 1: Proceed with the build (when changes are valid)
The script performs these checks:
- Detects if any changes were made in the current commit
- If the source locale file (
en.json) was modified:- Checks if other locale files were also updated
- Prevents the build if only the source file was changed
- Allows the build to proceed if:
- No changes were made to the source file
- Both source and other locale files were updated
Important Notes
- Vercel performs a shallow clone with
git clone --depth=10, so the script will only have access to the last 10 commits - The script runs in the same directory as your project's "Root Directory" setting in Vercel
- Make sure the script has executable permissions (
chmod +x vercel-build.sh) before committing
For more information about setting up GitHub Actions for translation workflows, see our GitHub Actions guide.
How is this guide?
Last updated on