fix: check allowed_bots before API call in checkHumanActor #916
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.
Summary
allowed_botscheck (wildcard*and specific bot list) before theoctokit.users.getByUsername()API callgithub-merge-queue[bot]that don't have regular GitHub user profilesProblem
checkHumanActorcallsoctokit.users.getByUsername()as its first action. Bot accounts likegithub-merge-queue[bot]return 404 from this API, causing the function to crash before theallowed_botsconfiguration is ever checked. This makesallowed_botsineffective for scheduled/cron workflows and any bot-triggered events.The GitHub workflow-level guard runs successfully, but the action fails with:
Changes
src/github/validation/actor.ts: Reordered to checkallowed_bots(wildcard and specific list) before making the API calltest/actor.test.ts: Added 3 tests with a mock that throws 404, verifying allowed bots bypass the API callTest plan
bun test test/actor.test.ts)bun run typecheck)bun run format:check)Fixes #900