Fix GH Actions for branch protection + bump to Node 24 #2
Workflow file for this run
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 PR | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| validate-skills: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect changed skill directories | |
| id: detect | |
| run: | | |
| # Get unique skill dirs under snowflake-skills/ or general-skills/ that were touched | |
| dirs=$(git diff --name-only origin/main...HEAD \ | |
| | grep -E '^(snowflake-skills|general-skills)/' \ | |
| | cut -d'/' -f1-2 \ | |
| | sort -u \ | |
| | while read -r d; do | |
| # Only include dirs that have or should have SKILL.md | |
| if [[ -f "$d/SKILL.md" ]] || [[ -f "$d/README.md" ]]; then | |
| echo "$d" | |
| fi | |
| done) | |
| echo "dirs=$dirs" >> "$GITHUB_OUTPUT" | |
| if [[ -n "$dirs" ]]; then | |
| echo "has_skills=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "has_skills=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Validate skill structure | |
| if: steps.detect.outputs.has_skills == 'true' | |
| run: | | |
| readarray -t skill_dirs <<< "${{ steps.detect.outputs.dirs }}" | |
| .github/scripts/validate-skill.sh "${skill_dirs[@]}" | |
| - name: Check skills table is up to date | |
| run: | | |
| cp snowflake-skills/README.md snowflake-skills/README.md.bak | |
| cp general-skills/README.md general-skills/README.md.bak | |
| .github/scripts/generate-skills-table.sh | |
| if ! diff -q snowflake-skills/README.md snowflake-skills/README.md.bak > /dev/null 2>&1; then | |
| echo "WARNING: Skills table in snowflake-skills/README.md is out of date." | |
| echo "It will be auto-updated when this PR merges to main." | |
| fi | |
| if ! diff -q general-skills/README.md general-skills/README.md.bak > /dev/null 2>&1; then | |
| echo "WARNING: Skills table in general-skills/README.md is out of date." | |
| echo "It will be auto-updated when this PR merges to main." | |
| fi | |
| mv snowflake-skills/README.md.bak snowflake-skills/README.md | |
| mv general-skills/README.md.bak general-skills/README.md | |
| - name: Check agent rules are in sync | |
| run: | | |
| .github/scripts/sync-agent-rules.sh | |
| if ! git diff --quiet .cursor/rules/ .windsurf/rules/ .claude/rules/ .gemini/; then | |
| echo "WARNING: Agent rule files are out of sync with SKILL.md sources." | |
| echo "They will be auto-synced when this PR merges to main." | |
| fi | |
| git checkout -- .cursor/rules/ .windsurf/rules/ .claude/rules/ .gemini/ 2>/dev/null || true |