Skip to content

Commit d1852af

Browse files
committed
Add error messages
1 parent 9604cd5 commit d1852af

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/qhelp-pr-preview.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,28 @@ jobs:
3737
3838
- name: QHelp preview
3939
run: |
40+
EXIT_CODE=0
4041
echo "QHelp previews:" > comment.txt
41-
cat "${{ runner.temp }}/paths.txt" | while read path; do
42+
while read path; do
4243
if [ ! -f "${path}" ]; then
4344
exit 1
4445
fi
4546
echo "<details> <summary>${path}</summary>"
4647
echo
47-
codeql generate query-help --format=markdown -- "./${path}"
48+
codeql generate query-help --format=markdown -- "./${path}" 2> errors.txt || EXIT_CODE="$?"
49+
if [ -s errors.txt ]; then
50+
echo "# errors/warnings:"
51+
echo '```'
52+
cat errors.txt
53+
cat errors.txt 1>&2
54+
echo '```'
55+
fi
4856
echo "</details>"
49-
done >> comment.txt
57+
done < "${{ runner.temp }}/paths.txt" >> comment.txt
58+
exit "${EXIT_CODE}"
5059
51-
- uses: actions/upload-artifact@v2
60+
- if: always()
61+
uses: actions/upload-artifact@v2
5262
with:
5363
name: comment
5464
path: comment.txt

0 commit comments

Comments
 (0)