Automation scripts
All scripts live under
.github/scripts/.
check-i18n-helper.sh
Validates that localization pages include the required default_lang_commit
front matter field. If pages are missing it, the script outputs a fix command:
npm run fix:i18n:new
check-links-shard.sh
Runs link checking for a specific shard by temporarily modifying
.htmltest.yml.
.github/scripts/check-links-shard.sh [-qk] <shard-id> <shard-regex>
| Flag | Description |
|---|---|
-q | Quiet mode |
-k | Keep modified .htmltest.yml (default: restore after run) |
-h | Show help |
The script injects the shard regular expression into the IgnoreDirs config,
runs npm run __check:links, and restores the original config unless -k is
used.
check-refcache.sh
Compares shard-specific refcache.json files against the main
static/refcache.json to detect cache inconsistencies after link checking.
.github/scripts/check-refcache.sh [directory]
Default directory: tmp/check-refcache. If differences are found, the script
suggests running npm run fix:refcache or adding a /fix:refcache comment to
the PR.
pr-approval-labels.sh
Manages PR approval labels based on review state and file ownership. Called by
the pr-approval-labels workflow.
How it works:
- Fetches PR data (files changed, latest reviews, current labels) via
gh. - Resolves
docs-approversteam members from the GitHub org API. - Determines required SIG teams by matching changed files against
.github/component-owners.yml(parses YAML manually, noyqdependency). - Checks whether each required group has an approving review.
- Adds or removes labels using tri-state logic (
true/false/unknown) to avoid changing labels when team membership can’t be fetched.
Required env vars: REPO, PR, GITHUB_TOKEN.
textlint.sh
Runs textlint and converts JSON output into GitHub Actions error annotations, which appear inline on PR diffs.
Exits with code 1 if any violations are found.
update-registry-versions.sh
Auto-updates package versions in data/registry/*.yml by querying upstream
registries. Supports: npm, Packagist, RubyGems, Go, NuGet, Hex, Maven.
- In CI (
GITHUB_ACTIONSset): creates a branch and opens a PR. - Locally: runs in dry-run mode by default. Use
-fto force real execution.
Deduplicates PRs by generating a SHA-1 tag from the update summary.