Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include introduction only in new GitHub reviews #27

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions rosdistro_reviewer/submitter/github.py
Original file line number Diff line number Diff line change
@@ -16,10 +16,12 @@
GITHUB_TOKEN_ENVIRONMENT_VARIABLE = EnvironmentVariable(
'GITHUB_TOKEN', 'Authentication token secret for GitHub')

BODY_HEADER = """Hi there, thanks for contributing to ROS!
INTRODUCTION = """Hi there, thanks for contributing to ROS!
This is an automated review generated by the [rosdistro-reviewer tool](https://github.com/ros-infrastructure/rosdistro-reviewer). If you'd like the tool to run again, just [re-request review from GitHub Actions](https://github.com/ros-infrastructure/rosdistro-reviewer?tab=readme-ov-file#running-rosdistro-reviewer-in-github-actions).
---
""" # noqa: E501


@@ -91,7 +93,14 @@ def _annotation_to_comment(
message = review.summarize()
recommendation = review.recommendation

# Check if we've already posted a review for this PR
already_reviewed = any(
review.user.login == 'github-actions[bot]'
for review in pr.get_reviews())
if not already_reviewed:
message = INTRODUCTION + message

pr.create_review(
body=BODY_HEADER + message,
body=message,
event=RECOMMENDATION_EVENTS[recommendation],
comments=comments)
1 change: 1 addition & 0 deletions test/spell_check.words
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ lenny
libdelta
linter
linting
login
mantic
metafunc
mktemp