org-root: robots.txt + apex redirect for sitemap discovery #1
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| name: Validate static files | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate robots.txt | |
| run: | | |
| # robots.txt must exist and contain a Sitemap directive | |
| test -f robots.txt | |
| grep -q '^Sitemap:' robots.txt | |
| grep -q 'User-agent:' robots.txt | |
| echo "robots.txt OK" | |
| - name: Validate index.html | |
| run: | | |
| test -f index.html | |
| grep -q 'godon-documentation' index.html | |
| echo "index.html OK" | |
| - name: Check no accidental content | |
| run: | | |
| # This repo should only contain robots.txt, index.html, README.md, .github/ | |
| ALLOWED="robots.txt index.html README.md" | |
| FOUND=$(find . -maxdepth 1 -type f ! -name '.gitignore' | sed 's|^\./||' | sort) | |
| UNEXPECTED=$(comm -23 <(echo "$FOUND") <(echo "$ALLOWED" | tr ' ' '\n' | sort)) | |
| if [ -n "$UNEXPECTED" ]; then | |
| echo "Unexpected files at root: $UNEXPECTED" | |
| exit 1 | |
| fi | |
| echo "File structure OK" |