Repository navigation
Deprecate prefab Admin Console; migrate command reference to built-in console page #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fail PRs that introduce UTF-8 BOMs in Markdown files. | |
| # | |
| # BOMs in Markdown cause real problems in this repo: heading regexes | |
| # (including the sentence-case sweep script) skip BOM-prefixed H1s, | |
| # some Markdown parsers render the BOM as a visible glyph, and | |
| # grep/diff output gets noisy. The Unicode standard also recommends | |
| # against UTF-8 BOMs. | |
| # | |
| # Workflow files for pull_request events are read from the PR's base | |
| # branch, so this file must live on every content branch (unity/v*, | |
| # unreal/v*, core/v*, etc.), not just main. | |
| name: Check for UTF-8 BOMs | |
| on: | |
| pull_request: | |
| paths: | |
| - '**/*.md' | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Detect UTF-8 BOMs in Markdown | |
| run: | | |
| offenders=$(find . -name '*.md' -not -path './node_modules/*' \ | |
| -exec grep -l $'^\xEF\xBB\xBF' {} \;) | |
| if [[ -n "$offenders" ]]; then | |
| echo "::error::Markdown files contain UTF-8 BOMs. Strip them and re-push." | |
| echo | |
| echo "Offending files:" | |
| echo "$offenders" | sed 's|^\./| |' | |
| echo | |
| echo "To strip locally (GNU sed):" | |
| echo " find . -name '*.md' -exec sed -i '1s/^\\xEF\\xBB\\xBF//' {} \\;" | |
| echo | |
| echo "Windows editors (Notepad, some VS Code configs) may insert BOMs" | |
| echo "when saving as UTF-8. Configure your editor to save as 'UTF-8'" | |
| echo "rather than 'UTF-8 with BOM'." | |
| exit 1 | |
| fi | |
| echo "No BOMs detected." |