Skip to content

Commit

Permalink
docs: post "no differences found" when no diff
Browse files Browse the repository at this point in the history
  • Loading branch information
hfudev committed Sep 17, 2024
1 parent 17140fc commit aefaf72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/diff_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def main(base_folder: str, preview_folder: str, output_dir: str):
preview_folder_html_rel_paths = set(
glob.glob('**/*.html', root_dir=preview_folder, recursive=True)
)
has_diff = False
for item in sorted(base_folder_html_rel_paths | preview_folder_html_rel_paths):
base_name = item if item in base_folder_html_rel_paths else ''
preview_name = item if item in preview_folder_html_rel_paths else ''
Expand Down Expand Up @@ -49,9 +50,13 @@ def main(base_folder: str, preview_folder: str, output_dir: str):
fw.write(diff)

diff_url = f'{os.getenv("GITLAB_PAGE_HTTPS_URL")}/-/idf-component-manager/-/jobs/{os.getenv("CI_JOB_ID")}/artifacts/{output_file}'
has_diff = True

table.add_row([base_name, preview_name, diff_url])

if not has_diff:
table = 'No differences found'

print(table)
if os.getenv('CI_JOB_ID'):
post_mr_comment(table)
Expand Down

0 comments on commit aefaf72

Please sign in to comment.