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 authored and fredericlepied committed Jan 3, 2024
1 parent 8166a95 commit 646540a
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 @@ -47,11 +47,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 646540a

Please sign in to comment.