Skip to content

Commit aad7bf4

Browse files
committed
Enhance workflow error reporting and validation processes
- Updated link-checker to provide clearer comments on broken links and how to fix them. - Improved sync-custom-nodes workflow documentation. - Enhanced template validation workflow to capture and comment on validation errors, including thumbnail issues, with specific guidance for resolution. This update aims to improve user experience by ensuring all links and templates are properly validated before merging.
1 parent 69beb54 commit aad7bf4

File tree

3 files changed

+52
-81
lines changed

3 files changed

+52
-81
lines changed

.github/workflows/link-checker.yml

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -198,67 +198,12 @@ jobs:
198198
lycheeReport = 'Lychee reported an error (non-zero exit) but no broken-link rows were parsed. Please check artifacts for details.';
199199
}
200200
201-
const comment = `## 🔗 Broken Links Found in Workflow Files
202-
203-
The link checker found broken or unreachable links in your workflow JSON files.
204-
205-
**Why this matters:** Broken model download links will prevent users from using the workflows properly. All URLs in \`properties.models[].url\` fields and MarkdownNote/Note widgets must be valid and accessible.
206-
207-
### ❌ Failed Links:
201+
const comment = `## ❌ Broken Links Found
208202
209203
${lycheeReport}
210204
211-
${excludedReport ? '---\n\n' + excludedReport + '\n\n**Note:** These links are intentionally excluded from checking. If you need to modify the exclusion rules, edit \`.lycheeignore\`.\n\n' : ''}
212-
213-
### Common Issues:
214-
215-
1. **404 Not Found**: The file or page doesn't exist
216-
- Verify the URL is correct
217-
- Check if the file was moved or renamed
218-
- Update to the correct URL
219-
220-
2. **Timeout**: Server didn't respond in time
221-
- Verify the URL is correct
222-
- Check if the server is temporarily down
223-
- Try accessing the URL manually
224-
225-
3. **Connection Failed**: Unable to reach the server
226-
- Verify the domain exists
227-
- Check if the repository/file was deleted
228-
229-
### How to Fix:
230-
231-
1. **For model URLs in \`properties.models[].url\`:**
232-
- Update the URL to a valid download link
233-
- Ensure the model file is still available
234-
- Test the URL manually before committing
235-
236-
2. **For links in MarkdownNote/Note widgets:**
237-
- Update or remove broken documentation links
238-
- Ensure all referenced resources are accessible
239-
240-
### Testing Links Locally:
241-
242-
\`\`\`bash
243-
# Extract and check links
244-
python3 scripts/check_links.py extract
245-
lychee links_to_check.txt
246-
247-
# View detailed report
248-
python3 scripts/check_links.py report
249-
250-
# View excluded links
251-
python3 scripts/check_links.py report-excluded
252-
\`\`\`
253-
254-
### 📦 Detailed Reports
255-
256-
For a complete list of all links and their sources, download the artifacts from this workflow run:
257-
- \`link_report_detailed.txt\` - Full detailed report showing all links and which files contain them
258-
- \`excluded_links.txt\` - Complete list of excluded links
259-
- \`lychee-report.md\` - Full lychee check report
260-
261-
**Note**: All links in workflow files must be valid and accessible before merging to ensure users can download required models and access documentation.`;
205+
${excludedReport ? '**Excluded:**\n' + excludedReport + '\n\n' : ''}
206+
**Fix:** Update or remove broken URLs in workflow files. Check artifacts for full report.`;
262207
263208
github.rest.issues.createComment({
264209
issue_number: context.issue.number,

.github/workflows/sync-custom-nodes.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Sync Custom Nodes Requirements
22

3-
# ⚠️ TEMPORARILY DISABLED - Remove the `if: false` condition below to re-enable
43
# This workflow automatically syncs requiresCustomNodes field in all index files
54
# when templates are changed in PRs.
6-
#
5+
#
76
# Process:
87
# 1. Scans all template JSON files (excluding index files) for cnr_id values
98
# 2. Extracts all non-comfy-core cnr_ids for each template

.github/workflows/validate-templates.yml

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,37 @@ jobs:
3131
pip install jsonschema
3232
3333
- name: Run validation script
34-
run: python scripts/validate_templates.py
35-
34+
id: validation
35+
run: |
36+
python scripts/validate_templates.py 2>&1 | tee validation_output.txt
37+
echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
38+
continue-on-error: true
39+
40+
- name: Comment on PR with validation errors
41+
if: steps.validation.outputs.exit_code != '0' && github.event_name == 'pull_request'
42+
uses: actions/github-script@v7
43+
with:
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
script: |
46+
const fs = require('fs');
47+
let output = '';
48+
try {
49+
output = fs.readFileSync('validation_output.txt', 'utf8');
50+
} catch (error) {
51+
output = 'Unable to read validation output';
52+
}
53+
54+
github.rest.issues.createComment({
55+
issue_number: context.issue.number,
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
body: `## ❌ Template Validation Failed
59+
60+
\`\`\`
61+
${output}
62+
\`\`\``
63+
});
64+
3665
- name: Check JSON syntax
3766
run: |
3867
echo "Checking JSON syntax..."
@@ -94,28 +123,26 @@ jobs:
94123
report = 'Unable to read thumbnail validation report';
95124
}
96125
97-
const comment = `## ❌ Thumbnail Validation Issues Found
98-
99-
Your template has thumbnail configuration issues that need to be resolved.
100-
101-
**Why this matters:** Templates need proper thumbnails to provide users with visual previews. Templates with special thumbnail variants like "compareSlider" or "hoverDissolve" require specific thumbnail files to work correctly.
102-
103-
### Validation Report:
104-
\`\`\`
105-
${report}
106-
\`\`\`
107-
108-
### How to Fix:
109-
1. **Missing thumbnails**: Ensure each template has at least one thumbnail file (e.g., \`template-1.webp\`)
110-
2. **Incomplete dual thumbnails**: Templates with \`thumbnailVariant: "compareSlider"\` or \`"hoverDissolve"\` need both \`-1\` and \`-2\` thumbnail files
111-
3. **Check file naming**: Thumbnail files should be named \`{template_name}-{number}.{extension}\`
112-
4. **Verify file format**: Use the correct file extension (\`.webp\`, \`.mp3\`, etc.) as specified in the template's \`mediaSubtype\`
113-
114-
**Note**: All templates must have proper thumbnails configured to ensure the best user experience when browsing templates.`;
126+
const comment = `## ❌ Thumbnail Validation Failed
127+
128+
\`\`\`
129+
${report}
130+
\`\`\`
131+
132+
**Fix:**
133+
- Missing: Add \`template-1.webp\`
134+
- Dual thumbnails (\`compareSlider\`/\`hoverDissolve\`): Need both \`-1\` and \`-2\` files
135+
- Check naming: \`{name}-{number}.{ext}\``;
115136

116137
github.rest.issues.createComment({
117138
issue_number: context.issue.number,
118139
owner: context.repo.owner,
119140
repo: context.repo.repo,
120141
body: comment
121-
});
142+
});
143+
144+
- name: Fail workflow if validation failed
145+
if: steps.validation.outputs.exit_code != '0' || steps.thumbnail_check.outputs.thumbnail_issues == 'true'
146+
run: |
147+
echo "❌ Validation failed"
148+
exit 1

0 commit comments

Comments
 (0)