-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
86 lines (76 loc) · 2.55 KB
/
action.yml
File metadata and controls
86 lines (76 loc) · 2.55 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
name: 'Pulser — Claude Code Skill Linter'
description: 'Lint Claude Code SKILL.md files against Anthropic best practices. 8 diagnostic rules with auto-fix.'
author: 'TheStack-ai'
branding:
icon: 'activity'
color: 'green'
inputs:
path:
description: 'Path to skills directory'
required: false
default: '.claude/skills'
strict:
description: 'Treat warnings as errors (exit 1 on any issue)'
required: false
default: 'false'
version:
description: 'pulser-cli version to install (e.g. 0.4.0, latest)'
required: false
default: 'latest'
outputs:
score:
description: 'Overall skill health score (0-100)'
value: ${{ steps.pulser.outputs.score }}
errors:
description: 'Number of errors found'
value: ${{ steps.pulser.outputs.errors }}
warnings:
description: 'Number of warnings found'
value: ${{ steps.pulser.outputs.warnings }}
total:
description: 'Total skills scanned'
value: ${{ steps.pulser.outputs.total }}
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pulser-cli
shell: bash
run: npm install -g pulser-cli@${{ inputs.version }}
- name: Run pulser
id: pulser
shell: bash
run: |
set +e
REPORT=$(pulser "${{ inputs.path }}" --format json --no-anim 2>&1)
EXIT_CODE=$?
set -e
if echo "$REPORT" | jq -e '.summary' > /dev/null 2>&1; then
SCORE=$(echo "$REPORT" | jq -r '.summary.score')
ERRORS=$(echo "$REPORT" | jq -r '.summary.errors')
WARNINGS=$(echo "$REPORT" | jq -r '.summary.warnings')
TOTAL=$(echo "$REPORT" | jq -r '.summary.total')
else
SCORE=0
ERRORS=-1
WARNINGS=-1
TOTAL=0
fi
echo "score=$SCORE" >> "$GITHUB_OUTPUT"
echo "errors=$ERRORS" >> "$GITHUB_OUTPUT"
echo "warnings=$WARNINGS" >> "$GITHUB_OUTPUT"
echo "total=$TOTAL" >> "$GITHUB_OUTPUT"
echo "::group::Pulser Diagnostic Report"
pulser "${{ inputs.path }}" --format text --no-anim 2>&1 || true
echo "::endgroup::"
if [ "${{ inputs.strict }}" = "true" ]; then
if [ "$ERRORS" -gt 0 ] || [ "$WARNINGS" -gt 0 ]; then
echo "::error::Pulser found $ERRORS error(s) and $WARNINGS warning(s). Score: $SCORE/100"
exit 1
fi
elif [ "$EXIT_CODE" -eq 1 ]; then
echo "::warning::Pulser found issues. Score: $SCORE/100. Use strict mode to fail the build."
fi