Skip to content

Conversation

matifali
Copy link
Member

@matifali matifali commented Oct 6, 2025

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
Copy link

github-actions bot commented Oct 6, 2025

✅ Preview binaries are ready!

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

Copy link

github-actions bot commented Oct 6, 2025

✅ 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
Copy link
Collaborator

@35C4n0r 35C4n0r left a comment

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
Copy link

github-actions bot commented Oct 6, 2025

✅ Preview binaries are ready!

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

Copy link

github-actions bot commented Oct 6, 2025

✅ 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
Copy link
Member Author

matifali commented Oct 6, 2025

@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

Copy link
Collaborator

@35C4n0r 35C4n0r left a comment

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