Skip to content

Commit c70e5d6

Browse files
T-GroCopilot
andauthored
Add skill-validation workflow for structural checks on skills and agents (#19668)
* Add skill-validation workflow for structural checks on skills and agents Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix skill-validator errors: rename skill dir, add agent name field - Rename .github/skills/expert-review/ to reviewing-compiler-prs/ to match frontmatter name (validator requires directory/name match) - Add missing name field to agentic-workflows.agent.md frontmatter Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8bd2fd3 commit c70e5d6

3 files changed

Lines changed: 94 additions & 0 deletions

File tree

.github/agents/agentic-workflows.agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
name: agentic-workflows
23
description: GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing
34
disable-model-invocation: true
45
---
File renamed without changes.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Skill Validation
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/skills/**'
7+
- '.github/agents/**'
8+
- '.github/workflows/skill-validation.yml'
9+
push:
10+
branches: [main]
11+
paths:
12+
- '.github/skills/**'
13+
- '.github/agents/**'
14+
- '.github/workflows/skill-validation.yml'
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: skill-validation-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
validate:
26+
name: Validate skills and agents
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
sparse-checkout: |
33+
.github/skills
34+
.github/agents
35+
persist-credentials: false
36+
37+
- name: Download skill-validator
38+
shell: bash
39+
run: |
40+
curl -fsSL --retry 3 --retry-all-errors -o skill-validator.tar.gz \
41+
https://github.com/dotnet/skills/releases/download/skill-validator-nightly/skill-validator-linux-x64.tar.gz
42+
mkdir -p skill-validator-bin
43+
tar -xzf skill-validator.tar.gz -C skill-validator-bin
44+
if [ ! -f skill-validator-bin/skill-validator ]; then
45+
echo "::error::skill-validator binary not found after extraction"
46+
exit 1
47+
fi
48+
chmod +x skill-validator-bin/skill-validator
49+
50+
- name: Run skill-validator check
51+
shell: bash
52+
run: |
53+
rc=0
54+
55+
if [ -d .github/skills ]; then
56+
echo "::group::Validate skills"
57+
set +e
58+
skill-validator-bin/skill-validator check --skills .github/skills --allow-repo-traversal --verbose 2>&1 | tee skill-check-skills.txt
59+
skills_rc=${PIPESTATUS[0]}
60+
set -e
61+
echo "::endgroup::"
62+
if [ "$skills_rc" -ne 0 ]; then rc=1; fi
63+
fi
64+
65+
if [ -d .github/agents ]; then
66+
echo "::group::Validate agents"
67+
set +e
68+
skill-validator-bin/skill-validator check --agents .github/agents --allow-repo-traversal --verbose 2>&1 | tee skill-check-agents.txt
69+
agents_rc=${PIPESTATUS[0]}
70+
set -e
71+
echo "::endgroup::"
72+
if [ "$agents_rc" -ne 0 ]; then rc=1; fi
73+
fi
74+
75+
# Write to step summary
76+
{
77+
echo "## skill-validator check"
78+
echo ""
79+
if [ "$rc" -eq 0 ]; then
80+
echo "All checks passed."
81+
else
82+
for f in skill-check-skills.txt skill-check-agents.txt; do
83+
if [ -f "$f" ]; then
84+
echo "### ${f}"
85+
echo '```'
86+
head -n 200 "$f"
87+
echo '```'
88+
echo ""
89+
fi
90+
done
91+
fi
92+
} >> "$GITHUB_STEP_SUMMARY"
93+
exit "$rc"

0 commit comments

Comments
 (0)