Skip to content

Commit dd02f26

Browse files
Correct formatting
1 parent 0ecea26 commit dd02f26

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

.github/workflows/accessibility.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,34 +88,34 @@ 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
92-
id: run_pa11y
93-
run: |
94-
num_files=$(jq length pa11y_targets.json)
95-
touch pa11y_output.md
96-
97-
if [ "$num_files" -eq 0 ]; then
98-
echo "No relevant HTML files to check. Skipping Pa11y." | tee pa11y_output.md
99-
else
100-
echo "### 🚦 Pa11y Accessibility Report" > pa11y_output.md
101-
echo "" >> pa11y_output.md
102-
103-
# Deduplicate HTML targets and read them into an array
104-
mapfile -t html_files < <(jq -r '.[]' pa11y_targets.json | sort -u)
105-
106-
for file in "${html_files[@]}"; do
107-
echo "#### 📄 $file" >> pa11y_output.md
108-
echo '```' >> pa11y_output.md
109-
result=$(npx pa11y-ci --reporter cli --config pa11yci.js "file://$(pwd)/$file" 2>&1 || true)
110-
echo "$result" >> pa11y_output.md
111-
echo '```' >> pa11y_output.md
112-
113-
# Attribution line for accessibility error source
114-
base=$(basename "$file" .html)
115-
echo "_⚠️ This issue likely originates from \`${base}.md\` or \`${base}.ipynb\`, which is used to generate this HTML file._" >> pa11y_output.md
116-
echo "" >> pa11y_output.md
117-
done
118-
fi
91+
- name: Run Pa11y CI on changed pages only and save output
92+
id: run_pa11y
93+
run: |
94+
num_files=$(jq length pa11y_targets.json)
95+
touch pa11y_output.md
96+
97+
if [ "$num_files" -eq 0 ]; then
98+
echo "No relevant HTML files to check. Skipping Pa11y." | tee pa11y_output.md
99+
else
100+
echo "### 🚦 Pa11y Accessibility Report" > pa11y_output.md
101+
echo "" >> pa11y_output.md
102+
103+
# Deduplicate HTML targets and read them into an array
104+
mapfile -t html_files < <(jq -r '.[]' pa11y_targets.json | sort -u)
105+
106+
for file in "${html_files[@]}"; do
107+
echo "#### 📄 $file" >> pa11y_output.md
108+
echo '```' >> pa11y_output.md
109+
result=$(npx pa11y-ci --reporter cli --config pa11yci.js "file://$(pwd)/$file" 2>&1 || true)
110+
echo "$result" >> pa11y_output.md
111+
echo '```' >> pa11y_output.md
112+
113+
# Attribution line for accessibility error source
114+
base=$(basename "$file" .html)
115+
echo "_⚠️ This issue likely originates from \`${base}.md\` or \`${base}.ipynb\`, which is used to generate this HTML file._" >> pa11y_output.md
116+
echo "" >> pa11y_output.md
117+
done
118+
fi
119119
120120
121121
- name: Debug GitHub context

0 commit comments

Comments
 (0)