@@ -28,10 +28,16 @@ jobs:
2828 run : |
2929 pip install -r scripts/requirements.txt
3030
31- - name : Validate YAML files
31+ - name : Validate YAML files (PRs - drafts allowed)
32+ if : github.event_name == 'pull_request'
3233 run : |
3334 python scripts/validate-schema.py data/paths/
3435
36+ - name : Validate YAML files (main branch - no drafts)
37+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
38+ run : |
39+ python scripts/validate-schema.py data/paths/ --no-draft
40+
3541 - name : Comment on PR (on failure)
3642 if : failure() && github.event_name == 'pull_request'
3743 uses : actions/github-script@v7
@@ -44,14 +50,32 @@ jobs:
4450 body: '❌ Schema validation failed. Please check the validation errors above and fix your YAML files according to the [schema documentation](../blob/main/SCHEMA.md).'
4551 })
4652
53+ - name : Check for draft paths
54+ if : success() && github.event_name == 'pull_request'
55+ id : check-drafts
56+ run : |
57+ DRAFT_COUNT=$(grep -rl "status: draft" data/paths/ 2>/dev/null | wc -l | tr -d ' ')
58+ echo "draft_count=$DRAFT_COUNT" >> $GITHUB_OUTPUT
59+ if [ "$DRAFT_COUNT" -gt 0 ]; then
60+ echo "Found $DRAFT_COUNT draft path(s)"
61+ echo "draft_files<<EOF" >> $GITHUB_OUTPUT
62+ grep -rl "status: draft" data/paths/ >> $GITHUB_OUTPUT
63+ echo "EOF" >> $GITHUB_OUTPUT
64+ fi
65+
4766 - name : Comment on PR (on success)
4867 if : success() && github.event_name == 'pull_request'
4968 uses : actions/github-script@v7
5069 with :
5170 script : |
71+ const draftCount = '${{ steps.check-drafts.outputs.draft_count }}';
72+ let body = '✅ All YAML files passed schema validation!';
73+ if (parseInt(draftCount) > 0) {
74+ body += `\n\n📝 **Note:** This PR contains ${draftCount} draft path(s) with \`status: draft\`. A maintainer will enhance these before merging.`;
75+ }
5276 github.rest.issues.createComment({
5377 issue_number: context.issue.number,
5478 owner: context.repo.owner,
5579 repo: context.repo.repo,
56- body: '✅ All YAML files passed schema validation!'
80+ body: body
5781 })
0 commit comments