Update __main__.py

This commit is contained in:
tooomm 2022-01-24 15:09:11 +01:00 committed by GitHub
parent bcfb1038c7
commit 8bceceae6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -408,11 +408,11 @@ def write_spoilers_xml(trice_dicts: Dict[str, List[Dict[str, Any]]]) -> bool:
old_xml_location = str(OUTPUT_DIR.joinpath(output_file_name))
if compare_xml_content(card_xml_file.name, old_xml_location):
print("::notice::No new data in spoiler.xml, skipping replacement")
print("No new data in spoiler.xml, skipping replacement")
return False
# Move new version to old location
print("::notice::Changes detected, replacing spoiler.xml with updated version")
print("Changes detected, replacing spoiler.xml with updated version")
shutil.move(card_xml_file.name, old_xml_location)
return True
@ -644,13 +644,13 @@ def main() -> None:
changed |= delete_old_files()
# Set output to deploy
if changed:
print("::set-output name=deploy::true")
print("::notice title=Updates available::New spoiler files will be uploaded")
else:
print("::set-output name=deploy::false")
print("::notice title=No updates available::There are no new spoiler cards")
if CI == true:
if changed:
print("::set-output name=deploy::true")
print("::notice title=Updates available::New spoiler files will be uploaded")
else:
print("::set-output name=deploy::false")
print("::notice title=No updates available::There are no new spoiler cards")
if __name__ == "__main__":
main()