Skip to content

Skip non-EAR PRs in find_reviewer and lock down workflow permissions - #404

Open
arash77 wants to merge 1 commit into
ERGA-consortium:mainfrom
arash77:fix/bot-hygiene
Open

Skip non-EAR PRs in find_reviewer and lock down workflow permissions#404
arash77 wants to merge 1 commit into
ERGA-consortium:mainfrom
arash77:fix/bot-hygiene

Conversation

@arash77

@arash77 arash77 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

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. 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 permissions block to all six workflows. The bot authenticates with GITHUB_APP_TOKEN, so the ambient GITHUB_TOKEN does not need anything. 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, 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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 requests dependency 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.

@erga-ear-bot

erga-ear-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Ping @arash77,
One week without any movements on this PR!

2 similar comments
@erga-ear-bot

erga-ear-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Ping @arash77,
One week without any movements on this PR!

@erga-ear-bot

erga-ear-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Ping @arash77,
One week without any movements on this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants