Skip to content

Commit

Permalink
Filter out ansi secquences of canonical diff
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Dec 22, 2023
1 parent 7148174 commit fd61303
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ jobs:
working-directory: otterdog-configs

- name: Generate canonical diff
run: ../otterdog/otterdog.sh canonical-diff ${{ github.repository_owner }} -c otterdog.json | tee "$GITHUB_WORKSPACE/canonical-diff.txt"
run: |
../otterdog/otterdog.sh canonical-diff ${{ github.repository_owner }} -c otterdog.json | tee "$GITHUB_WORKSPACE/canonical-diff-ansi.txt"
# filter out ansi escape sequences
cat "$GITHUB_WORKSPACE/canonical-diff-ansi.txt" | sed -e 's/\x1b\[[0-9;]*m//g' | sed -E 's/^([[:space:]]+)([-+!])/\2\1/g' | sed -E 's/^([[:space:]]+)([~])/!\1/g' > "$GITHUB_WORKSPACE/canonical-diff.txt"
working-directory: otterdog-configs

# Add a comment to the pull request with the diff
Expand Down

0 comments on commit fd61303

Please sign in to comment.