feat: Add agentready assessment workflow#5989
feat: Add agentready assessment workflow#5989ntkathole wants to merge 2 commits intofeast-dev:masterfrom
Conversation
1a6a8ad to
915bc23
Compare
915bc23 to
a23da73
Compare
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
a23da73 to
ad22bf4
Compare
120a781 to
2f9112a
Compare
2f9112a to
c151d14
Compare
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
c151d14 to
49bfe0e
Compare
| 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 approach
For 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:
- Search for an existing comment with a known marker (e.g.,
<!-- agentready-assessment -->) - If found, update it with
github.rest.issues.updateComment() - If not found, create a new one with
github.rest.issues.createComment()
This is the approach used by most CI bots (coverage reporters, size checkers, etc.) to keep PR conversations clean.
Prompt for agents
In .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.
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.