Wuhp commited on
Commit
e7fb2c0
·
1 Parent(s): 34bf6e4

Validate dashboard JavaScript in CI before deploying

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy-hf.yml +10 -0
.github/workflows/deploy-hf.yml CHANGED
@@ -15,6 +15,16 @@ jobs:
15
  - uses: actions/checkout@v4
16
  with:
17
  fetch-depth: 0
 
 
 
 
 
 
 
 
 
 
18
  - name: Validate Hugging Face token
19
  env:
20
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
15
  - uses: actions/checkout@v4
16
  with:
17
  fetch-depth: 0
18
+ - name: Validate dashboard JavaScript syntax
19
+ run: |
20
+ python3 - <<'PY'
21
+ from pathlib import Path
22
+ page = Path("app/index.html").read_text()
23
+ assert "<script>" in page and "</script>" in page
24
+ js = page.split("<script>", 1)[1].split("</script>", 1)[0]
25
+ Path("/tmp/asfb-inline.js").write_text(js)
26
+ PY
27
+ node --check /tmp/asfb-inline.js
28
  - name: Validate Hugging Face token
29
  env:
30
  HF_TOKEN: ${{ secrets.HF_TOKEN }}