chore(ci): Ensure triage workflows are consistent (#6108)

This commit is contained in:
Seth Vargo 2025-08-12 22:50:18 -04:00 committed by GitHub
parent b6da98e8e9
commit b655d8f062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 111 additions and 106 deletions

View File

@ -32,7 +32,7 @@ permissions:
jobs: jobs:
triage-issue: triage-issue:
if: > if: |-
github.repository == 'google-gemini/gemini-cli' && github.repository == 'google-gemini/gemini-cli' &&
(github.event_name == 'issues' || (github.event_name == 'issues' ||
github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_dispatch' ||
@ -45,18 +45,18 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- name: 'Checkout repository' - name: 'Checkout'
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
- name: 'Generate GitHub App Token' - name: 'Generate GitHub App Token'
id: 'generate_token' id: 'generate_token'
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b' # ratchet:actions/create-github-app-token@v2
with: with:
app-id: '${{ secrets.APP_ID }}' app-id: '${{ secrets.APP_ID }}'
private-key: '${{ secrets.PRIVATE_KEY }}' private-key: '${{ secrets.PRIVATE_KEY }}'
- name: 'Run Gemini Issue Triage' - name: 'Run Gemini Issue Triage'
uses: 'google-github-actions/run-gemini-cli@20351b5ea2b4179431f1ae8918a246a0808f8747' uses: 'google-github-actions/run-gemini-cli@06123c6a203eb7a964ce3be7c48479cc66059f23' # ratchet:google-github-actions/run-gemini-cli@v0
id: 'gemini_issue_triage' id: 'gemini_issue_triage'
env: env:
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}' GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'
@ -94,13 +94,13 @@ jobs:
## Steps ## Steps
1. Run: `gh label list --repo ${{ github.repository }} --limit 100` to get all available labels. 1. Run: `gh label list --repo "${REPOSITORY}" --limit 100` to get all available labels.
2. Review the issue title and body provided in the environment variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}". 2. Review the issue title and body provided in the environment variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
3. Ignore any existing priorities or tags on the issue. Just report your findings. 3. Ignore any existing priorities or tags on the issue. Just report your findings.
4. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. For area/* and kind/* limit yourself to only the single most applicable label in each case. 4. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. For area/* and kind/* limit yourself to only the single most applicable label in each case.
6. Apply the selected labels to this issue using: `gh issue edit ${{ github.event.issue.number }} --repo ${{ github.repository }} --add-label "label1,label2"`. 6. Apply the selected labels to this issue using: `gh issue edit "${ISSUE_NUMBER}" --repo "${REPOSITORY}" --add-label "label1,label2"`.
7. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 for anything more than 6 versions older than the most recent should add the status/need-retesting label. 7. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 for anything more than 6 versions older than the most recent should add the status/need-retesting label.
8. If you see that the issue doesnt look like it has sufficient information recommend the status/need-information label. 8. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label.
9. Use Area definitions mentioned below to help you narrow down issues. 9. Use Area definitions mentioned below to help you narrow down issues.
## Guidelines ## Guidelines
@ -192,19 +192,22 @@ jobs:
- name: 'Post Issue Triage Failure Comment' - name: 'Post Issue Triage Failure Comment'
if: |- if: |-
${{ failure() && steps.gemini_issue_triage.outcome == 'failure' }} ${{ failure() && steps.gemini_issue_triage.outcome == 'failure' }}
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
env:
REPOSITORY: '${{ github.repository }}'
RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
with: with:
github-token: '${{ steps.generate_token.outputs.token }}' github-token: '${{ steps.generate_token.outputs.token }}'
script: |- script: |-
github.rest.issues.createComment({ github.rest.issues.createComment({
owner: '${{ github.repository }}'.split('/')[0], owner: process.env.REPOSITORY.split('/')[0],
repo: '${{ github.repository }}'.split('/')[1], repo: process.env.REPOSITORY.split('/')[1],
issue_number: '${{ github.event.issue.number }}', issue_number: '${{ github.event.issue.number }}',
body: 'There is a problem with the Gemini CLI issue triaging. Please check the [action logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.' body: `There is a problem with the Gemini CLI issue triaging. Please check the [action logs](${process.env.RUN_URL}) for details.`
}) })
deduplicate-issues: deduplicate-issues:
if: > if: |-
github.repository == 'google-gemini/gemini-cli' && github.repository == 'google-gemini/gemini-cli' &&
vars.TRIAGE_DEDUPLICATE_ISSUES != '' && vars.TRIAGE_DEDUPLICATE_ISSUES != '' &&
(github.event_name == 'issues' || (github.event_name == 'issues' ||
@ -218,25 +221,25 @@ jobs:
timeout-minutes: 20 timeout-minutes: 20
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- name: 'Checkout repository' - name: 'Checkout'
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
- name: 'Generate GitHub App Token' - name: 'Generate GitHub App Token'
id: 'generate_token' id: 'generate_token'
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b' # ratchet:actions/create-github-app-token@v2
with: with:
app-id: '${{ secrets.APP_ID }}' app-id: '${{ secrets.APP_ID }}'
private-key: '${{ secrets.PRIVATE_KEY }}' private-key: '${{ secrets.PRIVATE_KEY }}'
- name: Log in to GitHub Container Registry - name: 'Log in to GitHub Container Registry'
uses: docker/login-action@v3 uses: 'docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1' # ratchet:docker/login-action@v3
with: with:
registry: ghcr.io registry: 'ghcr.io'
username: ${{ github.actor }} username: '${{ github.actor }}'
password: ${{ secrets.GITHUB_TOKEN }} password: '${{ secrets.GITHUB_TOKEN }}'
- name: 'Run Gemini Issue Deduplication' - name: 'Run Gemini Issue Deduplication'
uses: 'google-github-actions/run-gemini-cli@20351b5ea2b4179431f1ae8918a246a0808f8747' uses: 'google-github-actions/run-gemini-cli@06123c6a203eb7a964ce3be7c48479cc66059f23' # ratchet:google-github-actions/run-gemini-cli@v0
id: 'gemini_issue_deduplication' id: 'gemini_issue_deduplication'
env: env:
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}' GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'

View File

@ -23,16 +23,16 @@ permissions:
jobs: jobs:
triage-issues: triage-issues:
timeout-minutes: 10 timeout-minutes: 10
if: ${{ github.repository == 'google-gemini/gemini-cli' }} if: |-
${{ github.repository == 'google-gemini/gemini-cli' }}
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- name: 'Checkout repository' - name: 'Checkout'
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
- name: 'Generate GitHub App Token' - name: 'Generate GitHub App Token'
id: 'generate_token' id: 'generate_token'
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2 uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b' # ratchet:actions/create-github-app-token@v2
with: with:
app-id: '${{ secrets.APP_ID }}' app-id: '${{ secrets.APP_ID }}'
private-key: '${{ secrets.PRIVATE_KEY }}' private-key: '${{ secrets.PRIVATE_KEY }}'
@ -42,7 +42,6 @@ jobs:
env: env:
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}' GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'
GITHUB_REPOSITORY: '${{ github.repository }}' GITHUB_REPOSITORY: '${{ github.repository }}'
GITHUB_OUTPUT: '${{ github.output }}'
run: |- run: |-
set -euo pipefail set -euo pipefail
@ -66,7 +65,7 @@ jobs:
- name: 'Run Gemini Issue Triage' - name: 'Run Gemini Issue Triage'
if: |- if: |-
${{ steps.find_issues.outputs.issues_to_triage != '[]' }} ${{ steps.find_issues.outputs.issues_to_triage != '[]' }}
uses: 'google-github-actions/run-gemini-cli@20351b5ea2b4179431f1ae8918a246a0808f8747' uses: 'google-github-actions/run-gemini-cli@06123c6a203eb7a964ce3be7c48479cc66059f23' # ratchet:google-github-actions/run-gemini-cli@v0
id: 'gemini_issue_triage' id: 'gemini_issue_triage'
env: env:
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}' GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'
@ -104,28 +103,28 @@ jobs:
## Steps ## Steps
1. Run: `gh label list --repo ${{ github.repository }} --limit 100` to get all available labels. 1. Run: `gh label list --repo "${REPOSITORY}" --limit 100` to get all available labels.
2. Check environment variable for issues to triage: $ISSUES_TO_TRIAGE (JSON array of issues) 2. Check environment variable for issues to triage: $ISSUES_TO_TRIAGE (JSON array of issues)
3. Review the issue title, body and any comments provided in the environment variables. 3. Review the issue title, body and any comments provided in the environment variables.
4. Ignore any existing priorities or tags on the issue. 4. Ignore any existing priorities or tags on the issue.
5. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. 5. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*.
6. Get the list of labels already on the issue using `gh issue view ISSUE_NUMBER --repo ${{ github.repository }} --json labels -t '{{range .labels}}{{.name}}{{"\n"}}{{end}}' 6. Get the list of labels already on the issue using `gh issue view ISSUE_NUMBER --repo "${REPOSITORY}" --json labels -t '{{range .labels}}{{.name}}{{"\n"}}{{end}}'
7. For area/* and kind/* limit yourself to only the single most applicable label in each case. 7. For area/* and kind/* limit yourself to only the single most applicable label in each case.
8. Give me a single short paragraph about why you are selecting each label in the process. use the format Issue ID: , Title, Label applied:, Label removed, ovearll explanation 8. Give me a single short paragraph about why you are selecting each label in the process. use the format Issue ID: , Title, Label applied:, Label removed, ovearll explanation
9. Parse the JSON array from step 2 and for EACH INDIVIDUAL issue, apply appropriate labels using separate commands: 9. Parse the JSON array from step 2 and for EACH INDIVIDUAL issue, apply appropriate labels using separate commands:
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --add-label "label1"` - `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --add-label "label1"`
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --add-label "label2"` - `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --add-label "label2"`
- Continue for each label separately - Continue for each label separately
- IMPORTANT: Label each issue individually, one command per issue, one label at a time if needed. - IMPORTANT: Label each issue individually, one command per issue, one label at a time if needed.
- Make sure after you apply labels there is only one area/* and one kind/* label per issue. - Make sure after you apply labels there is only one area/* and one kind/* label per issue.
- To do this look for labels found in step 6 that no longer apply remove them one at a time using - To do this look for labels found in step 6 that no longer apply remove them one at a time using
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "label-name1"` - `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --remove-label "label-name1"`
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "label-name2"` - `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --remove-label "label-name2"`
- IMPORTANT: Remove each label one at a time, one command per issue if needed. - IMPORTANT: Remove each label one at a time, one command per issue if needed.
10. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 10. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5
- Anything more than 6 versions older than the most recent should add the status/need-retesting label - Anything more than 6 versions older than the most recent should add the status/need-retesting label
11. If you see that the issue doesnt look like it has sufficient information recommend the status/need-information label 11. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label
- After applying appropriate labels to an issue, remove the "status/need-triage" label if present: `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "status/need-triage"` - After applying appropriate labels to an issue, remove the "status/need-triage" label if present: `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --remove-label "status/need-triage"`
- Execute one `gh issue edit` command per issue, wait for success before proceeding to the next - Execute one `gh issue edit` command per issue, wait for success before proceeding to the next
Process each issue sequentially and confirm each labeling operation before moving to the next issue. Process each issue sequentially and confirm each labeling operation before moving to the next issue.
@ -231,25 +230,25 @@ jobs:
timeout-minutes: 20 timeout-minutes: 20
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
steps: steps:
- name: 'Checkout repository' - name: 'Checkout'
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
- name: 'Generate GitHub App Token' - name: 'Generate GitHub App Token'
id: 'generate_token' id: 'generate_token'
uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b' # ratchet:actions/create-github-app-token@v2
with: with:
app-id: '${{ secrets.APP_ID }}' app-id: '${{ secrets.APP_ID }}'
private-key: '${{ secrets.PRIVATE_KEY }}' private-key: '${{ secrets.PRIVATE_KEY }}'
- name: Log in to GitHub Container Registry - name: 'Log in to GitHub Container Registry'
uses: docker/login-action@v3 uses: 'docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1' # ratchet:docker/login-action@v3
with: with:
registry: ghcr.io registry: 'ghcr.io'
username: ${{ github.actor }} username: '${{ github.actor }}'
password: ${{ secrets.GITHUB_TOKEN }} password: '${{ secrets.GITHUB_TOKEN }}'
- name: 'Run Gemini Issue Deduplication Refresh' - name: 'Run Gemini Issue Deduplication Refresh'
uses: 'google-github-actions/run-gemini-cli@20351b5ea2b4179431f1ae8918a246a0808f8747' uses: 'google-github-actions/run-gemini-cli@06123c6a203eb7a964ce3be7c48479cc66059f23' # ratchet:google-github-actions/run-gemini-cli@v0
id: 'gemini_refresh_embeddings' id: 'gemini_refresh_embeddings'
env: env:
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}' GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'

View File

@ -1,36 +1,39 @@
name: Gemini Scheduled PR Triage 🚀 name: 'Gemini Scheduled PR Triage 🚀'
on: on:
schedule: schedule:
- cron: '*/15 * * * *' # Runs every 15 minutes - cron: '*/15 * * * *' # Runs every 15 minutes
workflow_dispatch: {} workflow_dispatch:
jobs: jobs:
audit-prs: audit-prs:
timeout-minutes: 15 timeout-minutes: 15
if: ${{ github.repository == 'google-gemini/gemini-cli' }} if: |-
${{ github.repository == 'google-gemini/gemini-cli' }}
permissions: permissions:
contents: read contents: 'read'
id-token: write id-token: 'write'
issues: write issues: 'write'
pull-requests: write pull-requests: 'write'
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
outputs: outputs:
prs_needing_comment: ${{ steps.run_triage.outputs.prs_needing_comment }} prs_needing_comment: '${{ steps.run_triage.outputs.prs_needing_comment }}'
steps: steps:
- name: Checkout repository - name: 'Checkout'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
- name: Generate GitHub App Token - name: 'Generate GitHub App Token'
id: generate_token id: 'generate_token'
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2 uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b' # ratchet:actions/create-github-app-token@v2
with: with:
app-id: ${{ secrets.APP_ID }} app-id: '${{ secrets.APP_ID }}'
private-key: ${{ secrets.PRIVATE_KEY }} private-key: '${{ secrets.PRIVATE_KEY }}'
- name: Run PR Triage Script - name: 'Run PR Triage Script'
id: run_triage id: 'run_triage'
shell: 'bash'
env: env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'
GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_REPOSITORY: '${{ github.repository }}'
run: ./.github/scripts/pr-triage.sh run: |-
./.github/scripts/pr-triage.sh