| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
| await github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: report | ||
| }); |
There was a problem hiding this comment.
🟡 PR comment spam: createComment creates a new comment on every push instead of updating existing one
The workflow triggers on pull_request with types [opened, synchronize, reopened], meaning it runs on every push to the PR branch. The "Comment on PR" step uses github.rest.issues.createComment() which creates a new comment each time, rather than finding and updating an existing AgentReady comment.
Impact and suggested approachFor an active PR with many pushes, this will flood the PR with duplicate AgentReady assessment comments — one per push. This makes the PR conversation noisy and hard to follow.
The standard pattern for bot comments in GitHub Actions is to:
This is the approach used by most CI bots (coverage reporters, size checkers, etc.) to keep PR conversations clean.
Prompt for agentsIn .github/workflows/agentready-assessment.yml, lines 51-78, modify the "Comment on PR" step's script to find and update an existing comment instead of always creating a new one. The approach:
1. Add a marker string like `<!-- agentready-assessment -->` to the comment body.
2. Before creating a comment, list existing comments on the PR using `github.rest.issues.listComments()` and search for one containing the marker.
3. If found, use `github.rest.issues.updateComment({ comment_id: existingComment.id, ... })` to update it.
4. If not found, use `github.rest.issues.createComment()` to create a new one.
Example pattern:
const marker = '<!-- agentready-assessment -->';
const body = marker + '\n' + report;
const { data: comments } = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
const existing = comments.find(c => c.body && c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
comment_id: existing.id,
owner: context.repo.owner,
repo: context.repo.repo,
body: body,
});
} else {
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body,
});
}
Was this helpful? React with 👍 or 👎 to provide feedback.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What this PR does / why we need it:
Add a GitHub Actions workflow that runs AgentReady assessments on pull
requests, pushes to main/master, and manual dispatch. Posts the assessment report as a PR comment when triggered by a
pull request.