Skip to content

Conversation

@danxmoran
Copy link
Contributor

Closes #476

When searching for an existing comment to overwrite, check the body of each comment to see if it includes the expected header. This should prevent Squawk from accidentally overwriting comments generated by other GHAs.

Closes sbdchd#476

When searching for an existing comment to overwrite, check the body of
each comment to see if it includes the expected header. This should
prevent Squawk from accidentally overwriting comments generated by other
GHAs.
@netlify
Copy link

netlify bot commented May 14, 2025

👷 Deploy request for squawkhq pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 8ac4642

match comments.iter().find(|x| {
x.user.r#type == "Bot"
&& x.user.login == bot_name
&& x.body.contains(existing_comment_text_includes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about using starts_with here to be even more specific, but I wasn't sure how that would play with the markdown generation

Copy link
Owner

@sbdchd sbdchd May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah is the issue that there's one bot account setup and multiple apps, other than squawk, use it?

Edit: read your issue, makes sense!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a comment explaining the reasoning? otherwise looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

Copy link
Owner

@sbdchd sbdchd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one minor comment about adding a comment!

match comments.iter().find(|x| {
x.user.r#type == "Bot"
&& x.user.login == bot_name
&& x.body.contains(existing_comment_text_includes)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a comment explaining the reasoning? otherwise looks good!

@danxmoran danxmoran requested a review from sbdchd May 14, 2025 23:29
Copy link
Owner

@sbdchd sbdchd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!

@sbdchd sbdchd added the automerge automerge with kodiak label May 14, 2025
@kodiakhq kodiakhq bot merged commit eff1f73 into sbdchd:master May 14, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge automerge with kodiak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upload-to-github incorrectly overwrites comments from other actions

2 participants