Skip to content

Commit

Permalink
Fix HTML comment appearing in Azure Pull Request mail notifications (#…
Browse files Browse the repository at this point in the history
…2521)

* Fix HTML comment appearing in Azure Pull Request mail notifications

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: nvuillam <nvuillam@users.noreply.github.com>
  • Loading branch information
nvuillam and nvuillam authored Apr 3, 2023
1 parent 432ccb7 commit c1633dc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l

- Core
- Fix failure of AzureCommentReporter when there is no pull request found in ENV vars
- Fix HTML comment appearing in Azure Pull Request mail notifications

- Documentation

Expand Down
4 changes: 3 additions & 1 deletion megalinter/reporters/AzureCommentReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def produce_report(self):
existing_thread_comment_id = None
for existing_thread in existing_threads:
for comment in existing_thread.comments or []:
if "<!-- MegaLinter Status Report -->" in (comment.content or ""):
if "MegaLinter is graciously provided by" in (
comment.content or ""
):
existing_thread_comment = existing_thread
existing_thread_comment_id = existing_thread.comments[0].id
existing_thread_id = existing_thread.id
Expand Down
2 changes: 1 addition & 1 deletion megalinter/reporters/GitlabCommentReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def produce_report(self):

# Check if there is already a MegaLinter comment
for comment in existing_comments:
if "<!-- MegaLinter Status Report -->" in comment.body:
if "MegaLinter is graciously provided by" in comment.body:
existing_comment = comment

# Process comment
Expand Down
1 change: 0 additions & 1 deletion megalinter/utils_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def build_markdown_summary(reporter_self, action_run_url):
+ "(https://www.ox.security/wp-content/uploads/2022/06/"
+ "logo.svg?ref=megalinter_comment)](https://www.ox.security/?ref=megalinter)_"
)
p_r_msg += os.linesep + "<!-- MegaLinter Status Report -->"
logging.debug("\n" + p_r_msg)
return p_r_msg

Expand Down

0 comments on commit c1633dc

Please sign in to comment.