Skip to content

build: added action to automatically triage issues #1

build: added action to automatically triage issues

build: added action to automatically triage issues #1

Workflow file for this run

name: Issue Triage with Gemini
on:
issues:
types: [opened, edited]
pull_request:
workflow_dispatch:
inputs:
title:
description: 'Mock Issue Title'
default: 'Test Issue'
body:
description: 'Mock Issue Body'
default: 'This is a test issue description.'
jobs:
triage:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Run Triage Script
id: run_script
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
ISSUE_TITLE: ${{ github.event.issue.title || github.event.inputs.title }}
ISSUE_BODY: ${{ github.event.issue.body || github.event.inputs.body }}
run: |
labels=$(python .github/scripts/triage_issue.py)
echo "labels=$labels" >> $GITHUB_OUTPUT
- name: Apply Labels
if: steps.run_script.outputs.labels != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Convert comma-separated labels to gh command arguments
IFS=',' read -ra ADDR <<< "${{ steps.run_script.outputs.labels }}"
for i in "${ADDR[@]}"; do
# Trim whitespace and only add if not empty
label=$(echo "$i" | xargs)
if [ -n "$label" ]; then
gh issue edit ${{ github.event.issue.number }} --add-label "$label"
fi
done