Skip to content

chore: prevent duplicate preview release comments#119

Merged
matifali merged 4 commits into
mainfrom
fix/pr-preview-duplicate-comments
Oct 6, 2025
Merged

chore: prevent duplicate preview release comments#119
matifali merged 4 commits into
mainfrom
fix/pr-preview-duplicate-comments

Conversation

@matifali

@matifali matifali commented Oct 6, 2025

Copy link
Copy Markdown
Member

Summary

  • Only create a PR comment if one with "✅ Preview binaries are ready!" doesn't already exist
  • Prevents spam when the workflow runs multiple times

Test plan

  • Trigger the workflow multiple times on a test PR
  • Verify only one comment is created

Only create a PR comment if one doesn't already exist. This prevents spam when the workflow runs multiple times.
@matifali
matifali requested a review from 35C4n0r October 6, 2025 11:47
@matifali matifali changed the title fix: prevent duplicate preview release comments chore: prevent duplicate preview release comments Oct 6, 2025
@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_119" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_119

@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_119" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_119

@matifali
matifali marked this pull request as draft October 6, 2025 11:57

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@matifali rather than checking all the comments, a better approach would be to get a variable from the previous step like this depending on the if condition, and then use it in the next step

echo "comment=true/false" >> "${GITHUB_OUTPUT}"

Add should_comment flag that's set based on whether a release is created (not updated). Only comment when creating new releases.
@matifali
matifali marked this pull request as ready for review October 6, 2025 12:05
@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_119" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_119

@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_119" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_119

@matifali
matifali requested a review from 35C4n0r October 6, 2025 12:16
@matifali

matifali commented Oct 6, 2025

Copy link
Copy Markdown
Member Author

@35C4n0r as the workflow gets triggered by another workflow its not possible to test it in this PR. PRs can only run an updated workflow file if the trigger is on: pull_request

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@matifali
matifali merged commit 957363d into main Oct 6, 2025
3 checks passed
@matifali
matifali deleted the fix/pr-preview-duplicate-comments branch October 6, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants