File tree Expand file tree Collapse file tree
contributing/samples/adk_team/adk_pr_triaging_agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515name : ADK Pull Request Triaging Agent
1616
1717on :
18- pull_request_target :
19- types : [opened, reopened, edited]
2018 schedule :
2119 # Run every 6 hours
2220 - cron : ' 0 */6 * * *'
2321 workflow_dispatch :
2422 inputs :
2523 pr_number :
26- description : ' The Pull Request number to triage'
27- required : true
24+ description : ' The Pull Request number to triage (leave empty for batch mode)'
25+ required : false
26+ type : ' string'
27+ pr_count :
28+ description : ' Number of PRs to process in batch mode (default: 10)'
29+ required : false
30+ default : ' 10'
2831 type : ' string'
2932
3033jobs :
3134 agent-triage-pull-request :
32- if : >-
33- github.event_name == 'schedule' ||
34- github.event_name == 'workflow_dispatch' || (
35- github.event.pull_request.head.repo.full_name == github.repository &&
36- !contains(github.event.pull_request.labels.*.name, 'google-contributor')
37- )
35+ if : github.repository == 'google/adk-python'
3836 runs-on : ubuntu-latest
3937 permissions :
4038 pull-requests : write
6260 OWNER : ' google'
6361 REPO : ' adk-python'
6462 PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number || github.event.inputs.pr_number || '' }}
63+ PR_COUNT_TO_PROCESS : ${{ github.event.inputs.pr_count || '10' }}
6564 INTERACTIVE : ${{ vars.PR_TRIAGE_INTERACTIVE }}
6665 PYTHONPATH : contributing/samples/adk_team
6766 run : python -m adk_pr_triaging_agent.main
Original file line number Diff line number Diff line change 1818
1919from adk_pr_triaging_agent import agent
2020from adk_pr_triaging_agent .settings import OWNER
21+ from adk_pr_triaging_agent .settings import PR_COUNT_TO_PROCESS
2122from adk_pr_triaging_agent .settings import PULL_REQUEST_NUMBER
2223from adk_pr_triaging_agent .settings import REPO
2324from adk_pr_triaging_agent .utils import call_agent_async
@@ -44,10 +45,14 @@ async def main():
4445 if pr_number :
4546 prompt = f"Please triage pull request #{ pr_number } !"
4647 else :
47- print ("No pull request number received. Operating in batch mode." )
48+ pr_count = parse_number_string (PR_COUNT_TO_PROCESS , default_value = 10 )
49+ print (
50+ "No pull request number received. Operating in batch mode (limit:"
51+ f" { pr_count } )."
52+ )
4853 prompt = (
49- "Please use 'list_untriaged_pull_requests' to find 10 pull requests "
50- " that need triaging, then triage each one according to your"
54+ f "Please use 'list_untriaged_pull_requests' to find { pr_count } pull"
55+ " requests that need triaging, then triage each one according to your"
5156 " instructions."
5257 )
5358
Original file line number Diff line number Diff line change 2828OWNER = os .getenv ("OWNER" , "google" )
2929REPO = os .getenv ("REPO" , "adk-python" )
3030PULL_REQUEST_NUMBER = os .getenv ("PULL_REQUEST_NUMBER" )
31+ PR_COUNT_TO_PROCESS = os .getenv ("PR_COUNT_TO_PROCESS" , "10" )
3132
3233IS_INTERACTIVE = os .environ .get ("INTERACTIVE" , "1" ).lower () in ["true" , "1" ]
You can’t perform that action at this time.
0 commit comments