Skip to content

Commit 9bf221d

Browse files
Copilotpelikhan
andcommitted
Merge main branch into PR
Merged commits: - Add vitest test suites for TypeScript functions (#8) - Add comprehensive input/output schema for stdio and http MCP transports (#7) - Add agentic workflow for action metadata consistency checking (#11) - Add agentic workflow for automated super-linter analysis and reporting (#4) Resolved merge conflict in dist/index.js.map by rebuilding the package. Co-authored-by: pelikhan <[email protected]>
1 parent 55ec7c7 commit 9bf221d

File tree

14 files changed

+1982
-33
lines changed

14 files changed

+1982
-33
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.
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "0 14 * * 1-5" # 2 PM UTC, weekdays only
6+
permissions:
7+
contents: read
8+
actions: read
9+
safe-outputs:
10+
create-issue:
11+
title-prefix: "[linter] "
12+
labels: [automation, code-quality]
13+
engine: copilot
14+
name: Super Linter Report
15+
timeout_minutes: 15
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version-file: .node-version
26+
cache: npm
27+
28+
- name: Install Dependencies
29+
run: npm ci
30+
31+
- name: Run Super Linter
32+
id: super-linter
33+
continue-on-error: true
34+
uses: super-linter/super-linter/slim@v8
35+
env:
36+
CHECKOV_FILE_NAME: .checkov.yml
37+
DEFAULT_BRANCH: main
38+
FILTER_REGEX_EXCLUDE: dist/**/*
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
LINTER_RULES_PATH: .
41+
VALIDATE_ALL_CODEBASE: true
42+
# Disable linters that are covered by other workflows or not applicable
43+
VALIDATE_BIOME_FORMAT: false # Prettier is used instead
44+
VALIDATE_BIOME_LINT: false # ESLint is used instead
45+
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false # Separate security workflow
46+
VALIDATE_JAVASCRIPT_ES: false # ESLint handles JS/TS linting
47+
VALIDATE_JSCPD: false # Copy-paste detection not required
48+
VALIDATE_TYPESCRIPT_ES: false # ESLint handles TypeScript
49+
VALIDATE_JSON: false # Not strictly enforced in this project
50+
LOG_FILE: super-linter.log
51+
CREATE_LOG_FILE: true
52+
53+
- name: Save Linter Output
54+
if: always()
55+
run: |
56+
mkdir -p /tmp/gh-aw
57+
if [ -f "super-linter.log" ]; then
58+
cp super-linter.log /tmp/gh-aw/linter-output.txt
59+
else
60+
echo "No super-linter.log file found" > /tmp/gh-aw/linter-output.txt
61+
fi
62+
63+
# Also capture GitHub step summary if available
64+
if [ -n "$GITHUB_STEP_SUMMARY" ]; then
65+
echo "" >> /tmp/gh-aw/linter-output.txt
66+
echo "---" >> /tmp/gh-aw/linter-output.txt
67+
cat "$GITHUB_STEP_SUMMARY" >> /tmp/gh-aw/linter-output.txt 2>/dev/null || true
68+
fi
69+
tools:
70+
bash:
71+
- 'cat /tmp/gh-aw/linter-output.txt'
72+
---
73+
74+
# Super Linter Analysis Report
75+
76+
You are an expert code quality analyst. Your task is to analyze the super-linter output and create a comprehensive issue report.
77+
78+
## Context
79+
80+
- **Repository**: ${{ github.repository }}
81+
- **Triggered by**: @${{ github.actor }}
82+
- **Run ID**: ${{ github.run_id }}
83+
84+
## Your Task
85+
86+
1. **Read the linter output** from `/tmp/gh-aw/linter-output.txt` using the bash tool
87+
2. **Analyze the findings**:
88+
- Categorize errors by severity (critical, high, medium, low)
89+
- Group errors by file or linter type
90+
- Identify patterns in the errors
91+
- Determine which errors are most important to fix first
92+
3. **Create a detailed issue** with the following structure:
93+
94+
### Issue Title
95+
Use format: "Code Quality Report - [Date] - [X] issues found"
96+
97+
### Issue Body Structure
98+
99+
```markdown
100+
## 🔍 Super Linter Analysis Summary
101+
102+
**Date**: [Current date]
103+
**Total Issues Found**: [Number]
104+
**Run ID**: ${{ github.run_id }}
105+
106+
## 📊 Breakdown by Severity
107+
108+
- **Critical**: [Count and brief description]
109+
- **High**: [Count and brief description]
110+
- **Medium**: [Count and brief description]
111+
- **Low**: [Count and brief description]
112+
113+
## 📁 Issues by Category
114+
115+
### [Category/Linter Name]
116+
- **File**: `path/to/file`
117+
- Line [X]: [Error description]
118+
- Impact: [Why this matters]
119+
- Suggested fix: [How to resolve]
120+
121+
[Repeat for other categories]
122+
123+
## 🎯 Priority Recommendations
124+
125+
1. [Most critical issue to address first]
126+
2. [Second priority]
127+
3. [Third priority]
128+
129+
## 📋 Full Linter Output
130+
131+
<details>
132+
<summary>Click to expand complete linter log</summary>
133+
134+
```
135+
[Include the full linter output here]
136+
```
137+
138+
</details>
139+
140+
## 🔗 References
141+
142+
- [Link to workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
143+
- [Super Linter Documentation](https://github.com/super-linter/super-linter)
144+
```
145+
146+
## Important Guidelines
147+
148+
- **Be concise but thorough**: Focus on actionable insights
149+
- **Prioritize issues**: Not all linting errors are equal
150+
- **Provide context**: Explain why each type of error matters
151+
- **Suggest fixes**: Give practical recommendations
152+
- **Use proper formatting**: Make the issue easy to read and navigate
153+
- **If no errors found**: Create a positive report celebrating clean code
154+
155+
## Security Note
156+
157+
Treat linter output as potentially sensitive. Do not expose credentials, API keys, or other secrets that might appear in file paths or error messages.

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing
2+
3+
## Development
4+
5+
### Install Dependencies
6+
7+
```bash
8+
npm install
9+
```
10+
11+
### Run Tests
12+
13+
```bash
14+
npm test
15+
```
16+
17+
### Build
18+
19+
```bash
20+
npm run package
21+
```
22+
23+
### Lint
24+
25+
```bash
26+
npm run lint
27+
```
28+
29+
### Format
30+
31+
```bash
32+
npm run format:write
33+
```

0 commit comments

Comments
 (0)