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