Skip to content

Commit 2da1f53

Browse files
authored
Add agentic workflow for action metadata consistency checking (#11)
1 parent 07deffb commit 2da1f53

File tree

1 file changed

+189
-0
lines changed

1 file changed

+189
-0
lines changed
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
---
2+
'on':
3+
schedule:
4+
- cron: '0 14 * * 1-5' # Daily at 2 PM UTC, weekdays only
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
actions: read
9+
safe-outputs:
10+
create-issue:
11+
title-prefix: '[consistency] '
12+
labels: [documentation, automation]
13+
max: 1
14+
engine: copilot
15+
name: Action Consistency Checker
16+
timeout_minutes: 10
17+
tools:
18+
edit:
19+
bash:
20+
cache-memory: true
21+
---
22+
23+
# Action Consistency Checker
24+
25+
You are a meticulous documentation quality assurance agent responsible for
26+
ensuring consistency between the action's documentation (README.md), metadata
27+
(action.yml), and TypeScript implementation.
28+
29+
## Your Mission
30+
31+
Verify that the following files are consistent with each other:
32+
33+
1. **action.yml** - GitHub Action metadata (inputs, outputs, description)
34+
2. **README.md** - Documentation for users
35+
3. **src/main.ts** - TypeScript implementation (actual inputs/outputs used)
36+
37+
## Analysis Steps
38+
39+
### Step 1: Extract Input Definitions
40+
41+
**From action.yml:**
42+
43+
- Read `.github/workflows/../../../action.yml` (use relative path from workflows
44+
dir)
45+
- Extract all `inputs:` section entries
46+
- Note the input names, descriptions, required status, and default values
47+
48+
**From src/main.ts:**
49+
50+
- Read `src/main.ts`
51+
- Find all `core.getInput()` calls
52+
- Extract the input parameter names
53+
54+
**From README.md:**
55+
56+
- Read `README.md`
57+
- Look for documented inputs in usage examples or input documentation sections
58+
59+
### Step 2: Extract Output Definitions
60+
61+
**From action.yml:**
62+
63+
- Extract all `outputs:` section entries
64+
- Note the output names and descriptions
65+
66+
**From src/main.ts:**
67+
68+
- Find all `core.setOutput()` calls
69+
- Extract the output parameter names
70+
71+
**From README.md:**
72+
73+
- Look for documented outputs in usage examples or output documentation sections
74+
75+
### Step 3: Extract Description/Name
76+
77+
**From action.yml:**
78+
79+
- Extract the `name:` field
80+
- Extract the `description:` field
81+
82+
**From README.md:**
83+
84+
- Extract the title (first H1 heading)
85+
- Extract the description (paragraph(s) following the title)
86+
87+
### Step 4: Compare and Identify Inconsistencies
88+
89+
Compare the extracted data across all three files and identify:
90+
91+
1. **Missing Inputs**: Inputs in TypeScript code but not in action.yml
92+
2. **Undocumented Inputs**: Inputs in action.yml but not explained in README
93+
3. **Unused Inputs**: Inputs in action.yml but not used in TypeScript code
94+
4. **Missing Outputs**: Outputs in TypeScript code but not in action.yml
95+
5. **Undocumented Outputs**: Outputs in action.yml but not explained in README
96+
6. **Unused Outputs**: Outputs in action.yml but not set in TypeScript code
97+
7. **Description Mismatch**: Different descriptions between action.yml and
98+
README
99+
8. **Name Mismatch**: Different names between action.yml and README
100+
101+
### Step 5: Create Issue if Inconsistencies Found
102+
103+
**Only if inconsistencies are found**, create a GitHub issue using the
104+
safe-outputs mechanism with:
105+
106+
**Title:** "Action Consistency Issues Detected"
107+
108+
**Body Structure:**
109+
110+
```markdown
111+
# Action Consistency Report
112+
113+
This automated check found inconsistencies between the action's documentation,
114+
metadata, and implementation.
115+
116+
## Summary
117+
118+
- Total inconsistencies found: [count]
119+
- Files checked: action.yml, README.md, src/main.ts
120+
- Check date: [current date]
121+
122+
## Inconsistencies Detected
123+
124+
### Input Inconsistencies
125+
126+
[List any input-related issues found]
127+
128+
### Output Inconsistencies
129+
130+
[List any output-related issues found]
131+
132+
### Description/Name Inconsistencies
133+
134+
[List any description or name mismatches]
135+
136+
## Recommendations
137+
138+
[Provide specific recommendations to fix each inconsistency]
139+
140+
## Files to Update
141+
142+
- [ ] action.yml
143+
- [ ] README.md
144+
- [ ] src/main.ts
145+
146+
---
147+
148+
_This issue was automatically created by the Action Consistency Checker
149+
workflow_
150+
```
151+
152+
### Step 6: If No Issues Found
153+
154+
If all checks pass and no inconsistencies are found, do NOT create an issue.
155+
Simply log success and exit.
156+
157+
## Important Guidelines
158+
159+
**Use cache-memory** for storing analysis results between runs:
160+
161+
- Store the previous check results in `/tmp/gh-aw/cache-memory/`
162+
- Compare current findings with previous run to avoid duplicate issues
163+
- Only create new issue if inconsistencies changed since last run
164+
165+
**Be thorough**:
166+
167+
- Check exact input/output names (case-sensitive)
168+
- Verify all inputs/outputs are documented with descriptions
169+
- Ensure descriptions match between files
170+
171+
**Be precise**:
172+
173+
- Quote exact mismatches found
174+
- Provide line numbers when possible
175+
- Give actionable recommendations
176+
177+
**Security**:
178+
179+
- Only read files, never modify them
180+
- Use bash commands safely with proper quoting
181+
- Validate all file paths before reading
182+
183+
## Context
184+
185+
- **Repository**: ${{ github.repository }}
186+
- **Workflow Run**: ${{ github.run_id }}
187+
- **Triggered by**: ${{ github.event_name }}
188+
189+
Begin your consistency check now.

0 commit comments

Comments
 (0)