|
| 1 | +# Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: ADK Stale Agent Auditor |
| 16 | + |
| 17 | +on: |
| 18 | + workflow_dispatch: |
| 19 | + schedule: |
| 20 | + - cron: '0 6 * * *' |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + issues: write |
| 25 | + pull-requests: write |
| 26 | + |
| 27 | +jobs: |
| 28 | + audit-stale-issues: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + timeout-minutes: 60 |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Generate Token |
| 34 | + uses: actions/create-github-app-token@v1 |
| 35 | + id: app-token |
| 36 | + with: |
| 37 | + app-id: ${{ secrets.APP_ID }} |
| 38 | + private-key: ${{ secrets.APP_PRIVATE_KEY }} |
| 39 | + owner: ${{ github.repository_owner }} |
| 40 | + |
| 41 | + - name: Checkout your repository |
| 42 | + uses: actions/checkout@v4 |
| 43 | + with: |
| 44 | + token: ${{ steps.app-token.outputs.token }} |
| 45 | + |
| 46 | + - name: Fetch Stale Agent Source |
| 47 | + uses: actions/checkout@v4 |
| 48 | + with: |
| 49 | + repository: google/adk-python |
| 50 | + path: external-adk-source |
| 51 | + sparse-checkout: | |
| 52 | + contributing/samples/adk_stale_agent |
| 53 | + sparse-checkout-cone-mode: false |
| 54 | + |
| 55 | + - name: Set up Python |
| 56 | + uses: actions/setup-python@v5 |
| 57 | + with: |
| 58 | + python-version: '3.11' |
| 59 | + |
| 60 | + - name: Install uv |
| 61 | + run: | |
| 62 | + curl -LsSf https://astral.sh/uv/install.sh | sh |
| 63 | + echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
| 64 | +
|
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + uv pip install --system requests google-adk |
| 68 | +
|
| 69 | + - name: Run Stale Agent |
| 70 | + env: |
| 71 | + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
| 72 | + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} |
| 73 | + |
| 74 | + OWNER: ${{ github.repository_owner }} |
| 75 | + REPO: ${{ github.event.repository.name }} |
| 76 | + |
| 77 | + LLM_MODEL_NAME: 'gemini-2.5-flash' |
| 78 | + STALE_HOURS_THRESHOLD: 72 |
| 79 | + CLOSE_HOURS_AFTER_STALE_THRESHOLD: 96 |
| 80 | + |
| 81 | + PYTHONPATH: external-adk-source/contributing/samples |
| 82 | + |
| 83 | + run: python -m adk_stale_agent.main |
0 commit comments