Skip to content

Commit

Permalink
Filter ANSI color codes from ansible-lint output
Browse files Browse the repository at this point in the history
Removes the ansi code before adding it to the GH step summary for a
propoer reading
  • Loading branch information
tonyskapunk committed Dec 19, 2023
1 parent d0df895 commit 3cdec7e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ jobs:
diff -u0 branch.output main.output | tail -n +3 > diff.output
echo "## Improvements over main branch:" | tee -a ${GITHUB_STEP_SUMMARY}
echo '```diff' >> ${GITHUB_STEP_SUMMARY}
grep '^+' diff.output | sed -e 's/^+/+FIXED: /' | tee -a ${GITHUB_STEP_SUMMARY}
grep '^+' diff.output |
sed -e 's/^+/+FIXED: /' |
sed -r 's/\x1B\[[0-9]{1,2}(;[0-9]{1,2})?[mGK]//g' |
tee -a ${GITHUB_STEP_SUMMARY}
echo '```' >> ${GITHUB_STEP_SUMMARY}
echo "## Regressions from main branch:" | tee -a ${GITHUB_STEP_SUMMARY}
echo '```diff' >> ${GITHUB_STEP_SUMMARY}
grep '^-' diff.output | sed -e 's/^-/-ERROR: /' | tee -a ${GITHUB_STEP_SUMMARY}
grep '^-' diff.output |
sed -e 's/^-/-ERROR: /' |
sed -r 's/\x1B\[[0-9]{1,2}(;[0-9]{1,2})?[mGK]//g' |
tee -a ${GITHUB_STEP_SUMMARY}
echo '```' >> ${GITHUB_STEP_SUMMARY}
if grep -q '^-' diff.output; then
echo "> Fix regressions listed above" | tee -a ${GITHUB_STEP_SUMMARY}
Expand Down

0 comments on commit 3cdec7e

Please sign in to comment.