|
| 1 | +name: Label New Issues |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +permissions: |
| 8 | + issues: write |
| 9 | + contents: read |
| 10 | + |
| 11 | +jobs: |
| 12 | + auto-label-issue: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout private action repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + repository: poweiw/goggles_action |
| 19 | + path: ./.github/actions/goggles_action # local path to store the action |
| 20 | + token: ${{ secrets.GOGGLES_ACTION_REPO_TOKEN }} # token to access poweiw/goggles_action |
| 21 | + ref: v1.2.1 |
| 22 | + |
| 23 | + - name: Use LLM to label the issue |
| 24 | + uses: ./.github/actions/goggles_action/actions/llm_label |
| 25 | + with: |
| 26 | + ACTION_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + LLM_MODEL_NAME: ${{ secrets.GOGGLES_LLM_MODEL_NAME }} |
| 28 | + LLM_TOKEN_SERVER_URL: ${{ secrets.GOGGLES_LLM_TOKEN_SERVER_URL }} |
| 29 | + LLM_TOKEN_CLIENT_ID: ${{ secrets.GOGGLES_LLM_TOKEN_CLIENT_ID }} |
| 30 | + LLM_TOKEN_CLIENT_SECRET: ${{ secrets.GOGGLES_LLM_TOKEN_CLIENT_SECRET }} |
| 31 | + LLM_GENERATE_URL: ${{ secrets.GOGGLES_LLM_GENERATE_URL }} |
| 32 | + LLM_TOKEN_SCOPE: ${{ secrets.GOGGLES_LLM_TOKEN_SCOPE }} |
| 33 | + REPO_OWNER: ${{ github.repository_owner }} |
| 34 | + REPO_NAME: ${{ github.event.repository.name }} |
| 35 | + ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 36 | + ISSUE_TITLE: ${{ github.event.issue.title }} |
| 37 | + ISSUE_BODY: ${{ github.event.issue.body }} |
| 38 | + GITHUB_API_URL: ${{ github.api_url }} |
| 39 | + ACTIONS_STEP_VERBOSE: false |
| 40 | + EXCLUDED_LABELS: "Investigating,internal-bug-tracked,stale,triaged,wontfix" |
| 41 | + LLM_SYSTEM_PROMPT: | |
| 42 | + You are an expert GitHub issue labeler. Your task is to analyze the provided issue title, issue body, and a list of available labels with their descriptions. |
| 43 | + Based on this information, select the single most appropriate label from the list that best captures the primary issue or request. |
| 44 | + Prefer selecting only one label that represents the main topic or problem. Only suggest multiple labels if the issue genuinely spans multiple distinct areas that are equally important. |
| 45 | + Respond with ONLY the chosen label name (e.g., 'bug', 'feature-request') or comma-separated names if multiple are truly needed. |
| 46 | + If no labels seem appropriate, respond with 'NONE'. |
| 47 | + Do not add any other text, explanation, or markdown formatting. |
0 commit comments