Skip to content

Commit d6603fe

Browse files
author
Lucas Adamski
committed
debug info for pixel validation
1 parent 4ad8c15 commit d6603fe

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

.github/workflows/pixel_validation.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,35 @@ jobs:
6363
git push
6464
fi
6565
66-
- name: Run pixel validation
67-
run: npm run validate-defs-without-formatting -- -g ../internal-github-asana-utils/user_map.yml
66+
- name: Run pixel validation (with annotations)
67+
id: validate
68+
shell: bash
69+
run: |
70+
set -o pipefail
71+
LOG=validation.log
72+
npm run validate-defs-without-formatting -- -g ../internal-github-asana-utils/user_map.yml 2>&1 | tee "$LOG"
73+
status=$?
74+
if [ $status -ne 0 ]; then
75+
echo "::group::Pixel validation errors"
76+
sed -n '1,200p' "$LOG"
77+
echo "::endgroup::"
78+
# Annotate lines that look like errors
79+
grep -i -E "error|fail" "$LOG" | sed 's/%/%25/g;s/\r/%0D/g;s/\n/%0A/g' | while read -r line; do
80+
echo "::error title=Pixel validation failed::${line}"
81+
done
82+
exit $status
83+
fi
6884
working-directory: PixelDefinitions
6985

86+
- name: Upload validation log
87+
if: always()
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: pixel-validation-log
91+
path: PixelDefinitions/validation.log
92+
if-no-files-found: ignore
93+
retention-days: 5
94+
7095

7196

7297

0 commit comments

Comments
 (0)