chore(deps): update dependency @types/node to v26.4.0 #415
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: Validate Rules | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'skills/**/rules/**/*.md' | |
| - 'packages/nextdns-scripts/src/**' | |
| pull_request: | |
| branches: [main, develop] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Check frontmatter in new skill files | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "Checking frontmatter in new .md files under skills/" | |
| git fetch origin ${{ github.base_ref }} | |
| NEW_FILES=$(git diff --name-only --diff-filter=A origin/${{ github.base_ref }}..HEAD | grep '^skills/.*\.md$' || true) | |
| if [ -z "$NEW_FILES" ]; then | |
| echo "No new .md files in skills/ directory" | |
| exit 0 | |
| fi | |
| echo "New files to validate:" | |
| echo "$NEW_FILES" | |
| MISSING_FRONTMATTER=0 | |
| while IFS= read -r file; do | |
| if [ -z "$file" ] || [ ! -f "$file" ]; then | |
| [ -n "$file" ] && echo "Skipping $file (file not found)" | |
| continue | |
| fi | |
| echo "Checking $file..." | |
| FILE_VALID=1 | |
| if ! head -n 1 "$file" | grep -q '^---$'; then | |
| echo "❌ ERROR: Missing frontmatter opening delimiter in $file" | |
| MISSING_FRONTMATTER=1 | |
| FILE_VALID=0 | |
| fi | |
| DELIMITER_COUNT=$(awk 'BEGIN {count=0} /^---$/ { if (++count == 2) exit } END { print count }' "$file") | |
| if [ "$DELIMITER_COUNT" -lt 2 ]; then | |
| echo "❌ ERROR: Missing frontmatter closing delimiter in $file" | |
| MISSING_FRONTMATTER=1 | |
| FILE_VALID=0 | |
| fi | |
| FRONTMATTER=$(awk '/^---$/ { if (++count == 2) exit; if (count == 1) next } count == 1' "$file") | |
| if [ -z "$FRONTMATTER" ]; then | |
| echo "❌ ERROR: Empty frontmatter in $file" | |
| MISSING_FRONTMATTER=1 | |
| FILE_VALID=0 | |
| fi | |
| REQUIRED_FIELDS=("title" "impact" "impactDescription" "type" "tags") | |
| for field in "${REQUIRED_FIELDS[@]}"; do | |
| if ! echo "$FRONTMATTER" | grep -qE "^[[:space:]]*${field}:"; then | |
| echo "❌ ERROR: Missing required field '${field}' in $file" | |
| MISSING_FRONTMATTER=1 | |
| FILE_VALID=0 | |
| fi | |
| done | |
| if [ $FILE_VALID -eq 1 ]; then | |
| echo "✓ $file has valid frontmatter" | |
| fi | |
| done <<< "$NEW_FILES" | |
| if [ $MISSING_FRONTMATTER -eq 1 ]; then | |
| echo "" | |
| echo "❌ Frontmatter validation failed. See AGENTS.md section 3 for required fields." | |
| exit 1 | |
| fi | |
| echo "✅ All new files have valid frontmatter" | |
| - name: Lint (format, markdown, rules, syntax) | |
| run: pnpm lint |