Skip to content

Commit 9e3b817

Browse files
Merge pull request #336 from coding-for-reproducible-research/accessibiliy_ineff
Update accessibility workflow
2 parents ef2c80f + 2e35405 commit 9e3b817

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

.github/workflows/accessibility.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,41 +88,27 @@ jobs:
8888
echo "Generated pa11y_targets.json:"
8989
cat pa11y_targets.json
9090
91-
- name: Run Pa11y CI on changed pages only and save output
91+
- name: Run Pa11y CI once on identified pages and save output
9292
id: run_pa11y
9393
shell: bash
9494
run: |
95-
num_files=$(jq length pa11y_targets.json)
9695
touch pa11y_output.md
9796
97+
num_files=$(jq length pa11y_targets.json)
9898
if [ "$num_files" -eq 0 ]; then
9999
echo "No relevant HTML files to check. Skipping Pa11y." | tee pa11y_output.md
100100
else
101101
echo "### 🚦 Pa11y Accessibility Report" > pa11y_output.md
102102
echo "" >> pa11y_output.md
103103
104-
mapfile -t html_files < <(jq -r '.[]' pa11y_targets.json | sort -u)
105-
total_files=${#html_files[@]}
106-
107-
for i in "${!html_files[@]}"; do
108-
file="${html_files[$i]}"
109-
current_index=$((i + 1))
110-
echo "🔎 Checking $current_index of $total_files: $file"
111-
112-
echo "#### 📄 $file" >> pa11y_output.md
113-
echo '```' >> pa11y_output.md
104+
# Run pa11y-ci once on all files listed in the config
105+
result=$(npx pa11y-ci --reporter cli --config pa11yci.js 2>&1 || true)
106+
echo "$result" >> pa11y_output.md
114107
115-
result=$(npx pa11y-ci --reporter cli --config pa11yci.js "file://$(pwd)/$file" 2>&1 || true)
116-
echo "$result" >> pa11y_output.md
117-
echo '```' >> pa11y_output.md
118-
119-
base=$(basename "$file" .html)
120-
echo "_⚠️ Any errors likely originates from the source file (e.g., \`filename.md\`, \`filename.ipynb\`) used to generate the HTML._" >> pa11y_output.md
121-
echo "" >> pa11y_output.md
122-
done
108+
echo "" >> pa11y_output.md
109+
echo "_⚠️ Any errors likely originate from the source file (e.g., \`filename.md\`, \`filename.ipynb\`)._" >> pa11y_output.md
123110
fi
124111
125-
126112
- name: 🔍 Debug comment body
127113
run: |
128114
echo "------- BEGIN COMMENT BODY -------"

0 commit comments

Comments
 (0)