Skip non-EAR PRs in find_reviewer and lock down workflow permissions - #404
Open
arash77 wants to merge 1 commit into
Open
Skip non-EAR PRs in find_reviewer and lock down workflow permissions#404arash77 wants to merge 1 commit into
arash77 wants to merge 1 commit into
Conversation
find_reviewer() called _check_pr_activity() before checking the project
label, so it ran against every open PR in the repo. The bot has been
adding DELAYED and STALLED labels and posting weekly ping comments on
unrelated PRs, including the Dependabot ones. The project label check
now happens first. EAR PRs still get their activity check regardless of
the other skip conditions, as before.
Add a permissions block to all six workflows. The bot authenticates
with GITHUB_APP_TOKEN, so the ambient GITHUB_TOKEN needs nothing. It is
set to {} everywhere except 5_ear_bot_approved_comment.yml, which needs
actions: read to list and download the artifact from the triggering run.
Add requests to ear_bot/requirements.txt. rev/get_EAR_reviewer.py
imports it directly and it was only resolving because PyGithub happens
to depend on it.
Add the usual Python caches to .gitignore.
This was referenced Aug 11, 2026
There was a problem hiding this comment.
Pull request overview
Prevents the reviewer bot from processing unrelated PRs while tightening workflow token permissions and dependency hygiene.
Changes:
- Filters non-EAR PRs before activity checks.
- Applies least-privilege permissions across six workflows.
- Adds the direct
requestsdependency and standard Python ignores.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
ear_bot/ear_bot_reviewer.py |
Filters PRs before activity handling. |
ear_bot/requirements.txt |
Adds requests. |
.gitignore |
Ignores Python-generated files. |
.github/workflows/1_ear_bot_pr.yml |
Removes ambient token permissions. |
.github/workflows/2+4_ear_bot_comment.yml |
Removes ambient token permissions. |
.github/workflows/3_ear_bot_reviewer.yml |
Removes ambient token permissions. |
.github/workflows/5_ear_bot_approved.yml |
Removes ambient token permissions. |
.github/workflows/5_ear_bot_approved_comment.yml |
Grants artifact read access only. |
.github/workflows/6_ear_bot_merge.yml |
Removes ambient token permissions. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Ping @arash77, |
2 similar comments
Contributor
|
Ping @arash77, |
Contributor
|
Ping @arash77, |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
find_reviewercalled_check_pr_activitybefore checking the project label, so it ran against every open PR in the repo. The bot has been adding DELAYED and STALLED labels and posting weekly ping comments on unrelated PRs. See #401, where it has pinged@dependabot[bot]twice. The project label check now happens first. EAR PRs still get their activity check regardless of the other skip conditions, same as before.Add a
permissionsblock to all six workflows. The bot authenticates withGITHUB_APP_TOKEN, so the ambientGITHUB_TOKENdoes not need anything. Set to{}everywhere except5_ear_bot_approved_comment.yml, which needsactions: readto list and download the artifact from the triggering run.Add
requeststoear_bot/requirements.txt.rev/get_EAR_reviewer.pyimports it directly and it was only resolving because PyGithub happens to depend on it.Add the usual Python caches to
.gitignore, which was only.DS_Store.Checked with a stale unlabelled PR and a stale labelled one. The unlabelled PR now gets no labels and no ping, and the labelled one still gets DELAYED and STALLED. Independent of #403, they touch different parts of the function.