⚒️ Add trusted-list bypass automation for reviewed blocklist exceptions#239069
⚒️ Add trusted-list bypass automation for reviewed blocklist exceptions#239069409H wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c4846e9. Configure here.
0xOhm
left a comment
There was a problem hiding this comment.
test/trusted-list-utils.ts:7 — parseTrustedListBypass doesn't filter comment-only lines
The regex /\s+#.*$/u only strips inline comments (preceded by whitespace). Pure comment lines like # These domains are... have # as the first character with no preceding whitespace, so they pass through into the bypass Set. Functionally harmless today since no blocklist entry would match a comment string, but it pollutes the Set and could mask issues. Suggest:
.filter((line) => line && !line.startsWith("#")).github/workflows/trusted-list-bypass.yml:82-108 — "Report completion" and "Commit" steps run even when the bypass script fails
Both steps use if: steps.pr.outputs.is_fork == 'false' without checking prior step success. In GitHub Actions, a custom if expression replaces the implicit success() check — so if an unauthorized user triggers /skip-trusted-lists and the Node script exits with an error, these steps still execute. The commit step is a harmless no-op, but the completion step posts "bypass check completed" which is misleading. Should add && success():
if: steps.pr.outputs.is_fork == 'false' && success()|
The issue is that the trusted-list bypass workflow says it will push a bypass commit and CI will rerun, but the push currently happens with the default GitHub intentionally suppresses most workflow runs caused by That leaves the PR in a bad middle state: the bypass file was updated, but the checks that should verify the new head commit may stay stale or missing. Someone would then need to manually rerun CI or push another commit, which defeats the purpose of this automation. Preferred fix: use a short-lived GitHub App installation token scoped only to this repo, with minimal permissions, only for the final push step. A fine-grained bot PAT scoped only to this repo is an acceptable fallback. Another option is to explicitly dispatch the Build and Test workflow after the commit, but then |

Summary
Adds a reviewed bypass flow for cases where a domain must be blocklisted even though it appears on a trusted comparison list such as Tranco, CoinMarketCap, CoinGecko, Snaps Registry, or known dapps.
Changes
test/test-lists.tsintotest/resources/trusted-list-bypass.txt.test/trusted-list-utils.ts..github/trusted-list-bypass-reviewers.jsonwith a list of initial reviewers./skip-trusted-listsPR comment automation.bin/apply-trusted-list-bypass.tsto:README.md.Notes
The automation only pushes bypass updates to same-repo PR branches. For forked PRs, a maintainer still needs to apply the bypass file update manually.
Note
Medium Risk
Adds an
issue_comment-triggered GitHub Action withcontents: writethat can commit to PR branches, so misconfiguration could allow unintended repository writes despite the reviewer allowlist guardrails. Logic also changes how trusted-list false positives are detected/waived, which can affect CI gating of blocklist changes.Overview
Adds a reviewer-gated bypass mechanism for cases where a blocklisted domain appears on CI’s trusted comparison lists.
Trusted-list exceptions are moved out of
test/test-lists.tsinto a new plaintexttest/resources/trusted-list-bypass.txt, with shared parsing/detection extracted intotest/trusted-list-detection.ts+test/trusted-list-utils.tsand list tests updated to load and honor the bypass file.Introduces
/skip-trusted-listsautomation: a new workflow listens for PR comments, verifies the commenter against.github/trusted-list-bypass-reviewers.json, runsbin/apply-trusted-list-bypass.tsto compute required bypass entries, and commits updates back to same-repo PR branches (reporting fork PRs as manual-only). Documentation is expanded inREADME.mdto explain the trusted-list checks and bypass process.Reviewed by Cursor Bugbot for commit 2be8734. Bugbot is set up for automated code reviews on this repo. Configure here.