Open History to see the last commit
1# check-skills.yml β Drop this into your library repo's .github/workflows/
2#
3# Validates intent skills on PRs. After a release or manual run, opens or
4# updates one review PR when existing skills, artifact coverage, or workspace
5# package coverage need review.
6#
7# Triggers: pull requests touching skills/artifacts, pushes to main affecting
8# docs/source paths, new release published, or manual workflow_dispatch.
9#
10# intent-workflow-version: 4
11#
12# Template variables (replaced by `intent setup`):
13# @tanstack/router β e.g. @tanstack/query or my-workspace workspace
14β
15name: Check Skills
16β
17concurrency:
18 group: check-skills-${{ github.ref }}
19 cancel-in-progress: true
20β
21on:
22 pull_request:
23 paths:
24 - 'skills/**'
25 - '**/skills/**'
26 - '_artifacts/**'
27 - '**/_artifacts/**'
28 push:
29 branches: [main]
30 paths:
31 - 'docs/**'
32 - 'packages/*/src/**'
33 release:
34 types: [published]
35 workflow_dispatch: {}
36β
37permissions: {}
38β
39jobs:
40 validate:
41 name: Validate intent skills
42 if: github.event_name == 'pull_request'
43 runs-on: ubuntu-latest
44 permissions:
45 contents: read
46 steps:
47 - name: Checkout
48 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49 with:
50 persist-credentials: false
51β
52 - name: Setup Node
53 uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
54 with:
55 node-version: 24
56 package-manager-cache: false
57β
58 - name: Install intent
59 run: npm install -g @tanstack/intent
60β
61 - name: Validate skills
62 run: intent validate --github-summary
63β
64 review:
65 name: Check intent skill coverage
66 if: github.event_name != 'pull_request'
67 runs-on: ubuntu-latest
68 permissions:
69 contents: write
70 pull-requests: write
71 steps:
72 - name: Checkout
73 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
74 with:
75 fetch-depth: 0
76 persist-credentials: true # review job pushes a generated branch
77β
78 - name: Setup Node
79 uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
80 with:
81 node-version: 24
82 package-manager-cache: false
83β
84 - name: Install intent
85 run: npm install -g @tanstack/intent
86β
87 - name: Check skills
88 id: stale
89 run: |
90 intent stale --github-review --package-label "@tanstack/router"
91β
92 - name: Open or update review PR
93 if: steps.stale.outputs.has_review == 'true'
94 env:
95 BASE_BRANCH: ${{ github.event.repository.default_branch }}
96 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 VERSION: ${{ github.event.release.tag_name || 'manual' }}
98 run: |
99 BRANCH="skills/review-${VERSION}"
100β
101 git config user.name "github-actions[bot]"
102 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
103β
104 git fetch origin "$BRANCH:refs/remotes/origin/$BRANCH" || true
105 if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
106 git checkout -B "$BRANCH" "origin/$BRANCH"
107 else
108 git checkout -b "$BRANCH"
109 git commit --allow-empty -m "chore: review intent skills for ${VERSION}"
110 git push origin "$BRANCH"
111 fi
112β
113 PR_URL="$(gh pr list --head "$BRANCH" --json url --jq '.[0].url')"
114 if [ -n "$PR_URL" ]; then
115 gh pr edit "$PR_URL" --body-file pr-body.md
116 else
117 gh pr create \
118 --title "Review intent skills (${VERSION})" \
119 --body-file pr-body.md \
120 --head "$BRANCH" \
121 --base "$BASE_BRANCH"
122 fi