Skip to content

Commit 63a5961

Browse files
committed
pipe-generateWcag update to use local file
1 parent e891389 commit 63a5961

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

.github/workflows/actions.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,34 @@ jobs:
1818
with:
1919
python-version: '3.x'
2020

21-
- name: Install Python dependencies
21+
- name: 🏅 Install Python dependencies
2222
run: pip install -r requirements.txt
2323

24-
- name: Run Python scripts
25-
run: |
26-
echo 🏅 - Generate JSON
27-
python tools/pipe-generateJson.py
24+
- name: 🏅 Run Python scripts
25+
run: python tools/pipe-generateJson.py
2826

29-
echo 🏅 - Generate JSON files
30-
python tools/pipe-generateJsonFiles.py
27+
- name: 🏅 Generate JSON files
28+
run: python tools/pipe-generateJsonFiles.py
3129

32-
echo 🏅 - Generate CSV
33-
python tools/pipe-generateCsv.py
30+
- name: 🏅 Generate CSV
31+
run: python tools/pipe-generateCsv.py
3432

35-
echo 🏅 - Generate Installers
36-
python tools/pipe-generateShFiles.py
33+
- name: 🏅 Generate Installers
34+
run: python tools/pipe-generateShFiles.py
3735

38-
echo 🏅 - Update themes in Gogh file
39-
python tools/pipe-updateThemes.py
36+
- name: 🏅 Update themes in Gogh file
37+
run: python tools/pipe-updateThemes.py
4038

41-
echo 🏅 - Pipeline run date
42-
python tools/pipe.py
39+
- name: 🏅 Pipeline run date
40+
run: python tools/pipe.py
4341

4442
- name: Set up Deno
4543
uses: denoland/setup-deno@v2
4644
with:
4745
deno-version: v2.x
4846

49-
- name: Run WCAG generator script with Deno
50-
run: |
51-
echo 🏅 - Running WCAG generator script
52-
deno run --allow-all tools/pipe-generateWcag.js
47+
- name: 🏅 Run WCAG generator script with Deno
48+
run: deno run --allow-all tools/pipe-generateWcag.js
5349

5450
- name: Commit and push changes
5551
env:

dist

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/pipe-generateWcag.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { ratio, score } from 'npm:wcag-color';
2-
import axios from 'npm:axios';
32
import fs from 'node:fs';
43

54
async function generateReport() {
6-
const response = await axios.get('https://raw.githubusercontent.com/Gogh-Co/Gogh/master/data/themes.json');
7-
const themes = response.data;
5+
const themes = JSON.parse(fs.readFileSync('data/themes.json', 'utf-8'));
86

97
const report = themes.map(theme => {
108
const background = theme.background;

0 commit comments

Comments
 (0)