Skip to content

Commit 3423a5b

Browse files
committed
build: read from stdin and print table of validation errors
1 parent 164cb09 commit 3423a5b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/markdown_links.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,17 @@ jobs:
9595
# Define the path to a utility for validating links:
9696
validate="${root}/lib/node_modules/@stdlib/_tools/links/validate/bin/cli"
9797
98-
${validate} '${{ steps.results.outputs.all_links }}'
98+
output=$(echo '${{ steps.results.outputs.all_links }}' | ${validate})
99+
if [[ "${output}" != "All links are valid." ]]; then
100+
echo "| Error | ID | URL |" >> $GITHUB_STEP_SUMMARY
101+
echo "| ----- | -- | --- |" >> $GITHUB_STEP_SUMMARY
102+
103+
echo "$output" | jq -r '.[] | [.error, .id, .url] | @tsv' | while IFS=$'\t' read -r error id url; do
104+
echo "| $error | $id | $url |" >> $GITHUB_STEP_SUMMARY
105+
done
106+
else
107+
echo "$output"
108+
fi
99109
100110
# Log the results:
101111
- name: 'Log results'

0 commit comments

Comments
 (0)