Skip to content

Commit 05aa3fa

Browse files
xuanyang15copybara-github
authored andcommitted
fix: Remove the PR triaging agent's dependence on "bot triaged" label
PiperOrigin-RevId: 819427872
1 parent f9c09ef commit 05aa3fa

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/pr-triage.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: ADK Pull Request Triaging Agent
33
on:
44
pull_request_target:
55
types: [opened, reopened, edited]
6+
workflow_dispatch:
7+
inputs:
8+
pr_number:
9+
description: 'The Pull Request number to triage'
10+
required: true
11+
type: 'string'
612

713
jobs:
814
agent-triage-pull-request:
9-
if: "!contains(github.event.pull_request.labels.*.name, 'bot triaged') && !contains(github.event.pull_request.labels.*.name, 'google-contributor')"
15+
if: github.event_name == 'workflow_dispatch' || !contains(github.event.pull_request.labels.*.name, 'google-contributor')
1016
runs-on: ubuntu-latest
1117
permissions:
1218
pull-requests: write
@@ -33,7 +39,7 @@ jobs:
3339
GOOGLE_GENAI_USE_VERTEXAI: 0
3440
OWNER: 'google'
3541
REPO: 'adk-python'
36-
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
42+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
3743
INTERACTIVE: ${{ vars.PR_TRIAGE_INTERACTIVE }}
3844
PYTHONPATH: contributing/samples
3945
run: python -m adk_pr_triaging_agent.main

contributing/samples/adk_pr_triaging_agent/agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ def add_comment_to_pr(pr_number: int, comment: str) -> dict[str, Any]:
298298
# 4. Steps
299299
When you are given a PR, here are the steps you should take:
300300
- Call the `get_pull_request_details` tool to get the details of the PR.
301-
- Skip the PR (i.e. do not label or comment) if the PR is closed or is labeled with "{BOT_LABEL}" or "google-contributior".
301+
- Skip the PR (i.e. do not label or comment) if any of the following is true:
302+
- the PR is closed
303+
- the PR is labeled with "google-contributior"
304+
- the PR is already labelled with the above labels (e.g. "documentation", "services", "tools", etc.) and has a reviewer assigned.
302305
- Check if the PR is following the contribution guidelines.
303306
- If it's not following the guidelines, recommend or add a comment to the PR that points to the contribution guidelines (https://github.com/google/adk-python/blob/main/CONTRIBUTING.md).
304307
- If it's following the guidelines, recommend or add a label to the PR.

0 commit comments

Comments
 (0)