[workflow] Don't add a comment when the first run of the formatter passes (#86335)

This was inadvertently changed in
2120f57410.
This commit is contained in:
Tom Stellard
2024-03-25 15:04:11 -07:00
committed by GitHub
parent 4cea2d049f
commit de917dc20e
2 changed files with 4 additions and 1 deletions

View File

@@ -73,7 +73,9 @@ jobs:
# to take advantage of the new --diff_from_common_commit option
# explicitly in code-format-helper.py and not have to diff starting at
# the merge base.
# Create an empty comments file so the pr-write job doesn't fail.
run: |
echo "[]" > comments &&
python ./code-format-tools/llvm/utils/git/code-format-helper.py \
--write-comment-to-file \
--token ${{ secrets.GITHUB_TOKEN }} \

View File

@@ -124,7 +124,8 @@ View the diff from {self.name} here.
existing_comment = self.find_comment(pr)
if args.write_comment_to_file:
self.comment = {"body": comment_text}
if create_new or existing_comment:
self.comment = {"body": comment_text}
if existing_comment:
self.comment["id"] = existing_comment.id
return