Repository navigation
Repo sync #991
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: 'Check content-linter rules docs' | |
| # Keeps generated content-linter rule docs in sync with code and markdownlint changes. | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - 'src/content-linter/**' | |
| # Markdownlint dependency changes can alter generated rule docs. | |
| - package-lock.json | |
| # Manual edits to generated docs must fail this check. | |
| - data/reusables/contributing/content-linter-rules.md | |
| - .github/workflows/content-linter-rules-docs.yml | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-content-linter-rules-docs: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: ./.github/actions/node-npm-setup | |
| - name: Check that content-linter-rules.md is up-to-date | |
| run: npm run generate-content-linter-docs | |
| - name: Fail if it isn't up-to-date | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git status | |
| git diff | |
| echo "" | |
| echo "" | |
| echo "content-linter-rules.md is out of date." | |
| echo "Please run 'npm run generate-content-linter-docs' and commit the changes." | |
| exit 1; | |
| fi |