Skip to content

Commit

Permalink
Add validation marker to index
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jul 31, 2023
1 parent 5e2548d commit 42f8e4f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/validate-and-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ jobs:
with open('index.html', 'w') as f:
f.write('<!doctype html><html><head><meta charset="utf-8"/><title>')
f.write('${{ github.repository }}')
f.write(' - Building Blocks</title></head><body><h1>')
f.write(' - Building Blocks</title><style>.validation-failed::before{color:red;content:"❌ "}.validation-passed::before{color:green;content:"✅️ "}</style></head><body><h1>')
f.write('${{ github.repository }}')
f.write('</h1><ul>')
for bblock in sorted(bblocks, key=lambda x: x['itemIdentifier']):
link = bblock.get('documentation', {}).get('slate', {}).get('url')
name = bblock['name']
identifier = bblock['itemIdentifier']
validation = 'passed' if bblock.get('validationPassed', True) else 'failed'
if link:
f.write(f'<li><a href="{link}"><tt>{identifier}</tt> - {name}</a></li>')
f.write(f'<li class="validation-{validation}"><a href="{link}"><tt>{identifier}</tt> - {name}</a></li>')
else:
f.write(f'<li><tt>{identifier}</tt> - {name}</li>')
f.write(f'<li class="validation-{validation}"><tt>{identifier}</tt> - {name}</li>')
f.write('</ul></body></html>')
- name: Setup Pages
if: ${{ github.event.repository.has_pages }}
Expand Down

0 comments on commit 42f8e4f

Please sign in to comment.