From 32808ea8a2cd3af3ffb377e858fde16978159b69 Mon Sep 17 00:00:00 2001 From: Sam LeDoux Date: Tue, 7 May 2024 12:56:58 -0400 Subject: [PATCH] fix bugs with check --- .github/workflows/rws-submissions-checks.yml | 2 +- RwsCheck.py | 4 ++-- check_sites.py | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rws-submissions-checks.yml b/.github/workflows/rws-submissions-checks.yml index 38d5f5bd..1360d612 100644 --- a/.github/workflows/rws-submissions-checks.yml +++ b/.github/workflows/rws-submissions-checks.yml @@ -64,7 +64,7 @@ jobs: message-path: "message.txt" refresh-message-position: true - name: Fail or Succeed - if: steps.read_results.outputs.contents != 'success' + if: startsWith(steps.read_results.outputs.contents, 'It appears you have failed') uses: actions/github-script@v3 with: script: | diff --git a/RwsCheck.py b/RwsCheck.py index 96cbae07..94670ad5 100644 --- a/RwsCheck.py +++ b/RwsCheck.py @@ -46,7 +46,7 @@ def __init__(self, rws_sites: json, etlds: PublicSuffixList, icanns: set): self.etlds = etlds self.icanns = icanns self.error_list = [] - self.associated_warning = [] + self.warning_texts = [] def validate_schema(self, schema_file): """Validates the canonical sites list @@ -185,7 +185,7 @@ def check_associated_count(self, check_sets): """ for primary, rws in check_sets.items(): if len(rws.associated_sites) > ASSOCIATED_LIMIT: - self.associated_warning.append( + self.warning_texts.append( f"Warning: the set for {primary} contains more than {ASSOCIATED_LIMIT} associated sites." ) diff --git a/check_sites.py b/check_sites.py index a4efa00e..01636ebe 100644 --- a/check_sites.py +++ b/check_sites.py @@ -146,13 +146,12 @@ def main(): except Exception as inst: error_texts.append(inst) # This message allows us to check the succes of our action - if rws_checker.error_list or error_texts: + if rws_checker.error_list or error_texts or rws_checker.warning_texts: for checker_error in rws_checker.error_list: print(checker_error) for error_text in error_texts: print(error_text) - elif rws_checker.associated_warning: - for warning in rws_checker.associated_warning: + for warning in rws_checker.warning_texts: print(warning) else: print("success", end='')