Skip to content

Commit

Permalink
Merge pull request #3 from reload/v2
Browse files Browse the repository at this point in the history
V2 tweaks.
  • Loading branch information
rasben authored Nov 20, 2022
2 parents 4a949f3 + 52e33a7 commit 6ae0e67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Example setup: https://github.com/reload/storypal/blob/main/.github/workflows/dr

- Have python3 + pip3 installed
- `pip3 install install wheel colorama requests validators pytidylib`
- `python3 compare.py --url=https://some-remote-api-url.com --workdir=drupal-regression`
- `python3 compare.py --url=https://some-remote-api-url.com`

If you want to test with the exact, markdown output that GitHub Action uses:

Expand Down
9 changes: 7 additions & 2 deletions compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,16 @@ class txtmod:

failed = False

if api_data['messages']['errors'] or html_errors:
error_messages = {}

if 'errors' in api_data['messages']:
error_messages = api_data['messages']['errors']

if error_messages or html_errors:
return_message += txtmod.BOLD + txtmod.UNDERLINE + "Encountered errors:" + txtmod.ENDBOLD + txtmod.ENDUNDERLINE + txtmod.NEWLINE + txtmod.NEWLINE
failed = True

for error in api_data['messages']['errors']:
for error in error_messages:
return_message += " - " + txtmod.FAIL + error + txtmod.ENDC + txtmod.NEWLINE

if html_errors:
Expand Down

0 comments on commit 6ae0e67

Please sign in to comment.