Skip to content

Commit

Permalink
Check index.html workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
smithumble committed Jun 4, 2024
1 parent de9f068 commit 6464d1b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check index.html

on:
[push,pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build index.html
run: |
python index_build.py
- name: Check index.html changes
run: |
(set -e; [[ $(git diff) ]] && { git diff; exit 1; } || exit 0)
9 changes: 0 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
layout: default
---
Expand Down Expand Up @@ -60,14 +59,6 @@
</li>
</ul>
</li>
<li>__pycache__ build_index.cpython-311 [
<a href="./__pycache__/build_index.cpython-311.pyc" target="_blank">pyc
</a> ]
</li>
<li>local mask_codes [
<a href="./local/mask_codes.json" target="_blank">json
</a> ]
</li>
<li>document_types
<ul>
<li>award [
Expand Down
3 changes: 1 addition & 2 deletions build_index.py → index_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from collections import defaultdict
import os

LAYOUT = """
---
LAYOUT = """---
layout: default
---
<body>
Expand Down
3 changes: 1 addition & 2 deletions json_files_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
def get_files_paths(root):
files = []
for name in os.listdir(root):
if name.startswith("."):
# skip hidden files
if name.startswith(root):
continue

path = os.path.join(root, name)
Expand Down

0 comments on commit 6464d1b

Please sign in to comment.