-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yml
More file actions
92 lines (75 loc) · 2.36 KB
/
action.yml
File metadata and controls
92 lines (75 loc) · 2.36 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
name: 'Agent Ready Check'
description: 'Check your repository readiness for AI coding agents across 9 areas'
author: 'Agent Ready'
branding:
icon: 'check-circle'
color: 'green'
inputs:
path:
description: 'Path to check (relative to repository root)'
required: false
default: '.'
fail-on-missing:
description: 'Fail the action if any area has missing items'
required: false
default: 'false'
outputs:
result:
description: 'JSON result of the readiness check'
passed:
description: 'Whether all areas are complete (true/false)'
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install dependencies
shell: bash
working-directory: ${{ github.action_path }}
run: npm ci
- name: Build agent-ready
shell: bash
working-directory: ${{ github.action_path }}
run: npm run build
- name: Run check
id: check
shell: bash
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_FAIL_ON_MISSING: ${{ inputs.fail-on-missing }}
run: |
SCAN_PATH="${GITHUB_WORKSPACE}/${INPUT_PATH}"
SCAN_PATH="${SCAN_PATH%/}"
STRICT_FLAG=""
if [[ "$INPUT_FAIL_ON_MISSING" == "true" ]]; then
STRICT_FLAG="--strict"
fi
echo "::group::Running agent-ready check"
echo "Checking: $SCAN_PATH"
set +e
RESULT=$(node "${{ github.action_path }}/dist/index.js" check "$SCAN_PATH" --json $STRICT_FLAG 2>&1)
EXIT_CODE=$?
set -e
echo "::endgroup::"
echo "result<<RESULT_EOF" >> $GITHUB_OUTPUT
echo "$RESULT" >> $GITHUB_OUTPUT
echo "RESULT_EOF" >> $GITHUB_OUTPUT
if [[ $EXIT_CODE -eq 0 ]]; then
echo "passed=true" >> $GITHUB_OUTPUT
else
echo "passed=false" >> $GITHUB_OUTPUT
fi
# Summary
echo "### Agent Ready Check Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
echo "$RESULT" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Fail if missing
if: inputs.fail-on-missing == 'true' && steps.check.outputs.passed == 'false'
shell: bash
run: |
echo "::error::Repository has missing agent-ready items"
exit 1