fix: prevent bot loop & enable E2E for forks#74
Conversation
Add 'if: github.actor != gh-simili-bot && github.actor != github-actions[bot]' guard to the triage job so the bot's own comments do not re-trigger the workflow, causing duplicate triage reports. Applied to both the main triage.yml and the generated triage.yml in the E2E test pipeline. Fixes #73 Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
📝 WalkthroughWalkthroughTwo GitHub Actions workflows (e2e-test.yml and triage.yml) are updated with conditional guards that prevent the gh-simili-bot and github-actions[bot] from triggering the triage job, eliminating unintended workflow reruns caused by bot-generated comments. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Simili Triage ReportNote Quality Score: 9.5/10 (Excellent) Classification
Quality Improvements
Similar Threads
Generated by Simili Bot |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/e2e-test.yml (1)
230-231: Guard is correct, but the e2e loop test only exercises thegithub-actions[bot]branch.The embedded triage.yml does not pass
github_tokenin itswith:block, so the action always usesGITHUB_TOKENand the triggering actor is alwaysgithub-actions[bot]. Thegh-simili-botbranch of theif:guard (which covers the production scenario whereSIMILI_BOT_TOKENis supplied) is never exercised by the e2e loop-prevention test.Consider adding
github_token: ${{ secrets.GH_PAT }}to the embedded triage.yml'swith:block and updating theBOTvariable in the poll/loop-check steps accordingly, so the e2e test mirrors the production token path.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/e2e-test.yml around lines 230 - 231, The e2e test only hits the github-actions[bot] branch because the embedded triage.yml doesn't pass a PAT; update the embedded triage.yml's with: block to include github_token: ${{ secrets.GH_PAT }} so the action uses the GH_PAT (simulating SIMILI_BOT_TOKEN) and then adjust the BOT variable used in the poll/loop-check steps to match the simulated actor (gh-simili-bot) so the if: guard (github.actor != 'gh-simili-bot' && github.actor != 'github-actions[bot]') is exercised for both branches; locate the embedded triage.yml and the poll/loop-check steps (variables named BOT or references to the poll/loop-check logic) and change their token and BOT settings accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/e2e-test.yml:
- Around line 230-231: The e2e test only hits the github-actions[bot] branch
because the embedded triage.yml doesn't pass a PAT; update the embedded
triage.yml's with: block to include github_token: ${{ secrets.GH_PAT }} so the
action uses the GH_PAT (simulating SIMILI_BOT_TOKEN) and then adjust the BOT
variable used in the poll/loop-check steps to match the simulated actor
(gh-simili-bot) so the if: guard (github.actor != 'gh-simili-bot' &&
github.actor != 'github-actions[bot]') is exercised for both branches; locate
the embedded triage.yml and the poll/loop-check steps (variables named BOT or
references to the poll/loop-check logic) and change their token and BOT settings
accordingly.
🧪 E2E Test❌ Bot responded: no Test repo → gh-simili-bot/simili-e2e-22143742374 Auto-generated by E2E pipeline |
The previous guard 'github.actor != gh-simili-bot' was too broad —
it also skipped the job when gh-simili-bot opens an issue (which is
exactly what the E2E test does for the trigger issue).
Corrected to only skip issue_comment events from the bot:
if: github.event_name != 'issue_comment' ||
(github.actor != 'gh-simili-bot' && github.actor != 'github-actions[bot]')
Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
🧪 E2E Test✅ Bot responded: yes Test repo → gh-simili-bot/simili-e2e-22144058691 Auto-generated by E2E pipeline |
Simili Triage ReportNote Quality Score: 9.5/10 (Excellent) Classification
Quality Improvements
Similar Threads
Warning Possible Duplicate (Confidence: 90%) Generated by Simili Bot |
Problem
issue_comment: createdevent re-triggers the triage workflow, causing a double-post loop.BOT_PATand API keys are missing.Fixes
if:guard to skip triage execution when actor isgh-simili-botorgithub-actions[bot]. Applied to both maintriage.ymland generated test workflow.pull_request_target. This runs in the context of the base branch (main) with full secrets access, but explicitly checks out the PR code.Fixes #73. Enables CI for external contributors.