-
Notifications
You must be signed in to change notification settings - Fork 153
chore: Add GitHub Actions workflow file for enforcing metadata in docs #2099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c497bb7
chore: Add GitHub Actions workflow file for enforcing metadata in docs
crazyuploader f473792
chore: Add tags
crazyuploader 94e3fd2
fix: Update GitHub Actions workflow file for checking metadata
crazyuploader d0e1ebf
docs: Update tags
crazyuploader 652f0eb
Update check-metadata-docs.yml
crazyuploader 980d61e
Update check-metadata-docs.yml
crazyuploader e062929
Update tags
crazyuploader f6d5a02
Merge branch 'main' into chore/add-github-metadata-checker
crazyuploader 67567f0
Switch to Husky pre-commit for metadata check
crazyuploader b642c01
Update CONTRIBUTING.md
crazyuploader ce67552
Update check-docs-metadata.js
crazyuploader 13822e4
Chore: Fix tests
crazyuploader bbe30d4
Chore: Add description requirement for docs
crazyuploader 53728ad
Update CONTRIBUTING.md
crazyuploader File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Docs Metadata Guard | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "data/docs/**" | ||
| - "next.config.js" | ||
| - "scripts/check-docs-metadata.js" | ||
| - "tests/docs-metadata.test.js" | ||
| - "tests/fixtures/**" | ||
| - "package.json" | ||
| - ".github/workflows/docs-metadata-guard.yml" | ||
|
|
||
| jobs: | ||
| check-metadata: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --frozen-lockfile --non-interactive | ||
|
|
||
| - name: Run docs metadata tests | ||
| run: yarn test:docs-metadata | ||
|
|
||
| - name: Validate docs metadata | ||
| run: yarn check:docs-metadata |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,23 @@ | ||
| #!/usr/bin/env sh | ||
|
|
||
| set -e | ||
|
|
||
| echo 'husky (pre-commit): running lint-staged' | ||
| yarn lint-staged | ||
|
|
||
| STAGED_FILES=$(git diff --cached --name-only) | ||
|
|
||
| # Check for docs redirect changes | ||
| if printf '%s\n' "$STAGED_FILES" | grep -E '^(data/docs/.*\.mdx|next\.config\.js|scripts/check-doc-redirects\.js)$' >/dev/null; then | ||
| echo 'husky (pre-commit): verifying docs redirects' | ||
| yarn check:doc-redirects | ||
| else | ||
| echo 'husky (pre-commit): skipping docs redirect check (no relevant changes staged)' | ||
| fi | ||
|
|
||
| # Check for docs metadata | ||
| if printf '%s\n' "$STAGED_FILES" | grep -E '^data/docs/.*\.mdx$' >/dev/null; then | ||
| echo 'husky (pre-commit): validating docs metadata' | ||
| HUSKY_PRE_COMMIT=true yarn check:docs-metadata | ||
| else | ||
| echo 'husky (pre-commit): skipping docs metadata check (no documentation changes staged)' | ||
| fi |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.