-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add agentready assessment workflow #5989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: AgentReady Assessment | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| push: | ||
| branches: [main, master] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| assess: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.sha }} | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install AgentReady | ||
| run: | | ||
| pip install agentready | ||
|
|
||
| - name: Run AgentReady Assessment | ||
| continue-on-error: true | ||
| run: | | ||
| agentready assess . --verbose | ||
|
|
||
| - name: Upload Assessment Reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: agentready-reports | ||
| path: ${{ github.workspace }}/.agentready/ | ||
| include-hidden-files: true | ||
| retention-days: 30 | ||
|
|
||
| - name: Comment on PR | ||
| if: always() && github.event_name == 'pull_request' | ||
| continue-on-error: true | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const agentreadyDir = path.join(process.env.GITHUB_WORKSPACE, '.agentready'); | ||
|
|
||
| if (!fs.existsSync(agentreadyDir)) { | ||
| console.log('No .agentready directory found'); | ||
| return; | ||
| } | ||
|
|
||
| const mdFiles = fs.readdirSync(agentreadyDir) | ||
| .filter(f => f.startsWith('report-') && f.endsWith('.md')) | ||
| .sort() | ||
| .reverse(); | ||
|
|
||
| if (mdFiles.length === 0) { | ||
| console.log('No markdown report found'); | ||
| return; | ||
| } | ||
|
|
||
| const report = fs.readFileSync(path.join(agentreadyDir, mdFiles[0]), 'utf8'); | ||
|
|
||
| await github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: report | ||
| }); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 PR comment spam:
createCommentcreates a new comment on every push instead of updating existing oneThe workflow triggers on
pull_requestwith types[opened, synchronize, reopened], meaning it runs on every push to the PR branch. The "Comment on PR" step usesgithub.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:
<!-- agentready-assessment -->)github.rest.issues.updateComment()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
Was this helpful? React with 👍 or 👎 to provide feedback.