Skip to content

Issue Triage Action errors: Failed to parse labels JSON from Gemini output #229

@ameer00

Description

@ameer00

TL;DR

I am using Gemini CLI v 0.1.22 and I performed a /setup-github in my repo to set up the GitHub Actions.
Both of the issue triage actions are failing with errors.

Expected behavior

Add labels to the issue.

Observed behavior

Errors. See logs below.

Action YAML

name: '🏷️ Gemini Automated Issue Triage'

on:
  issues:
    types:
      - 'opened'
      - 'reopened'
  issue_comment:
    types:
      - 'created'
  workflow_dispatch:
    inputs:
      issue_number:
        description: 'issue number to triage'
        required: true
        type: 'number'

concurrency:
  group: '${{ github.workflow }}-${{ github.event.issue.number }}'
  cancel-in-progress: true

defaults:
  run:
    shell: 'bash'

permissions:
  contents: 'read'
  id-token: 'write'
  issues: 'write'
  statuses: 'write'

jobs:
  triage-issue:
    if: |-
      github.event_name == 'issues' ||
      github.event_name == 'workflow_dispatch' ||
      (
        github.event_name == 'issue_comment' &&
        contains(github.event.comment.body, '@gemini-cli /triage') &&
        contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
      )
    timeout-minutes: 5
    runs-on: 'ubuntu-latest'
    steps:
      - name: 'Checkout repository'
        uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4

      - name: 'Generate GitHub App Token'
        id: 'generate_token'
        if: |-
          ${{ vars.APP_ID }}
        uses: 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' # ratchet:actions/create-github-app-token@v2
        with:
          app-id: '${{ vars.APP_ID }}'
          private-key: '${{ secrets.APP_PRIVATE_KEY }}'

      - name: 'Get Repository Labels'
        id: 'get_labels'
        uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
        with:
          github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
          script: |-
            const { data: labels } = await github.rest.issues.listLabelsForRepo({
              owner: context.repo.owner,
              repo: context.repo.repo,
            });
            const labelNames = labels.map(label => label.name);
            core.setOutput('available_labels', labelNames.join(','));
            core.info(`Found ${labelNames.length} labels: ${labelNames.join(', ')}`);
            return labelNames;

      - name: 'Run Gemini Issue Analysis'
        uses: 'google-github-actions/run-gemini-cli@v0'
        id: 'gemini_issue_analysis'
        env:
          GITHUB_TOKEN: '' # Do not pass any auth token here since this runs on untrusted inputs
          ISSUE_TITLE: '${{ github.event.issue.title }}'
          ISSUE_BODY: '${{ github.event.issue.body }}'
          ISSUE_NUMBER: '${{ github.event.issue.number }}'
          REPOSITORY: '${{ github.repository }}'
          AVAILABLE_LABELS: '${{ steps.get_labels.outputs.available_labels }}'
        with:
          gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}'
          gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
          gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
          gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}'
          gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
          gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
          use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}'
          use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}'
          settings: |-
            {
              "debug": ${{ fromJSON(env.DEBUG || env.ACTIONS_STEP_DEBUG || false) }},
              "maxSessionTurns": 25,
              "coreTools": [
                "run_shell_command(echo)"
              ]
            }
          prompt: |-
            ## Role

            You are an issue triage assistant. Analyze the current GitHub issue
            and identify the most appropriate existing labels. Use the available
            tools to gather information; do not ask for information to be
            provided.

            ## Steps

            1. Review the available labels in the environment variable: "${AVAILABLE_LABELS}".
            2. Review the issue title and body provided in the environment
               variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
            3. Classify the issue by the appropriate labels from the available labels.
            4. Output the appropriate labels for this issue in JSON format with explanation, for example:
               
               {"labels_to_set": ["kind/bug", "priority/p0"], "explanation": "This is a critical bug report affecting main functionality"}
               
            5. If the issue cannot be classified using the available labels, output:
               
               {"labels_to_set": [], "explanation": "Unable to classify this issue with available labels"}
               

            ## Guidelines

            - Only use labels that already exist in the repository
            - Assign all applicable labels based on the issue content
            - Reference all shell variables as "${VAR}" (with quotes and braces)
            - Output only valid JSON format
            - Do not include any explanation or additional text, just the JSON

      - name: 'Apply Labels to Issue'
        if: |-
          ${{ steps.gemini_issue_analysis.outputs.summary != '' }}
        env:
          REPOSITORY: '${{ github.repository }}'
          ISSUE_NUMBER: '${{ github.event.issue.number }}'
          LABELS_OUTPUT: '${{ steps.gemini_issue_analysis.outputs.summary }}'
        uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
        with:
          github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
          script: |-
            // Strip code block markers if present
            const rawLabels = process.env.LABELS_OUTPUT;
            core.info(`Raw labels JSON: ${rawLabels}`);
            let parsedLabels;
            try {
              const trimmedLabels = rawLabels.replace(/^(?:json)?\s*/, '').replace(/\s*$/, '').trim();
              parsedLabels = JSON.parse(trimmedLabels);
              core.info(`Parsed labels JSON: ${JSON.stringify(parsedLabels)}`);
            } catch (err) {
              core.setFailed(`Failed to parse labels JSON from Gemini output: ${err.message}\nRaw output: ${rawLabels}`);
              return;
            }

            const issueNumber = parseInt(process.env.ISSUE_NUMBER);

            // Set labels based on triage result
            if (parsedLabels.labels_to_set && parsedLabels.labels_to_set.length > 0) {
              await github.rest.issues.setLabels({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: issueNumber,
                labels: parsedLabels.labels_to_set
              });
              const explanation = parsedLabels.explanation ? ` - ${parsedLabels.explanation}` : '';
              core.info(`Successfully set labels for #${issueNumber}: ${parsedLabels.labels_to_set.join(', ')}${explanation}`);
            } else {
              // If no labels to set, leave the issue as is
              const explanation = parsedLabels.explanation ? ` - ${parsedLabels.explanation}` : '';
              core.info(`No labels to set for #${issueNumber}, leaving as is${explanation}`);
            }

      - name: 'Post Issue Analysis Failure Comment'
        if: |-
          ${{ failure() && steps.gemini_issue_analysis.outcome == 'failure' }}
        env:
          ISSUE_NUMBER: '${{ github.event.issue.number }}'
          RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
        uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
        with:
          github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
          script: |-
            github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: parseInt(process.env.ISSUE_NUMBER),
              body: 'There is a problem with the Gemini CLI issue triaging. Please check the [action logs](${process.env.RUN_URL}) for details.'
            })

Log output

2025-08-21T23:27:01.3412714Z Current runner version: '2.328.0'
2025-08-21T23:27:01.3436558Z ##[group]Runner Image Provisioner
2025-08-21T23:27:01.3437344Z Hosted Compute Agent
2025-08-21T23:27:01.3437858Z Version: 20250818.377
2025-08-21T23:27:01.3438535Z Commit: 3c593e9f75fe0b87e893bca80d6e12ba089c61fc
2025-08-21T23:27:01.3439224Z Build Date: 2025-08-18T14:52:18Z
2025-08-21T23:27:01.3439779Z ##[endgroup]
2025-08-21T23:27:01.3440642Z ##[group]Operating System
2025-08-21T23:27:01.3441190Z Ubuntu
2025-08-21T23:27:01.3441657Z 24.04.2
2025-08-21T23:27:01.3442224Z LTS
2025-08-21T23:27:01.3442640Z ##[endgroup]
2025-08-21T23:27:01.3443118Z ##[group]Runner Image
2025-08-21T23:27:01.3443725Z Image: ubuntu-24.04
2025-08-21T23:27:01.3444188Z Version: 20250818.1.0
2025-08-21T23:27:01.3445179Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250818.1/images/ubuntu/Ubuntu2404-Readme.md
2025-08-21T23:27:01.3447092Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250818.1
2025-08-21T23:27:01.3448054Z ##[endgroup]
2025-08-21T23:27:01.3449261Z ##[group]GITHUB_TOKEN Permissions
2025-08-21T23:27:01.3451817Z Contents: read
2025-08-21T23:27:01.3452494Z Issues: write
2025-08-21T23:27:01.3453003Z Metadata: read
2025-08-21T23:27:01.3453457Z Statuses: write
2025-08-21T23:27:01.3453986Z ##[endgroup]
2025-08-21T23:27:01.3456266Z Secret source: Actions
2025-08-21T23:27:01.3457152Z Prepare workflow directory
2025-08-21T23:27:01.3980093Z Prepare all required actions
2025-08-21T23:27:01.4035494Z Getting action download info
2025-08-21T23:27:01.7484524Z Download action repository 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' (SHA:11bd71901bbe5b1630ceea73d27597364c9af683)
2025-08-21T23:27:01.8463945Z Download action repository 'actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e' (SHA:df432ceedc7162793a195dd1713ff69aefc7379e)
2025-08-21T23:27:02.3464390Z Download action repository 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' (SHA:60a0d83039c74a4aee543508d2ffcb1c3799cdea)
2025-08-21T23:27:02.6863093Z Download action repository 'google-github-actions/run-gemini-cli@v0' (SHA:a3bf79042542528e91937b3a3a6fbc4967ee3c31)
2025-08-21T23:27:03.1489018Z Getting action download info
2025-08-21T23:27:03.2625107Z Download action repository 'google-github-actions/auth@v2' (SHA:6fc4af4b145ae7821d527454aa9bd537d1f2dc5f)
2025-08-21T23:27:03.6085147Z Complete job name: triage-issue
2025-08-21T23:27:03.6877694Z ##[group]Run actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2025-08-21T23:27:03.6879274Z with:
2025-08-21T23:27:03.6879997Z   repository: ameer00/games
2025-08-21T23:27:03.6881277Z   token: ***
2025-08-21T23:27:03.6882007Z   ssh-strict: true
2025-08-21T23:27:03.6882762Z   ssh-user: git
2025-08-21T23:27:03.6883534Z   persist-credentials: true
2025-08-21T23:27:03.6884397Z   clean: true
2025-08-21T23:27:03.6885178Z   sparse-checkout-cone-mode: true
2025-08-21T23:27:03.6886136Z   fetch-depth: 1
2025-08-21T23:27:03.6886885Z   fetch-tags: false
2025-08-21T23:27:03.6887651Z   show-progress: true
2025-08-21T23:27:03.6888455Z   lfs: false
2025-08-21T23:27:03.6889183Z   submodules: false
2025-08-21T23:27:03.6889966Z   set-safe-directory: true
2025-08-21T23:27:03.6891185Z ##[endgroup]
2025-08-21T23:27:03.7959970Z Syncing repository: ameer00/games
2025-08-21T23:27:03.7963141Z ##[group]Getting Git version info
2025-08-21T23:27:03.7964409Z Working directory is '/home/runner/work/games/games'
2025-08-21T23:27:03.7966092Z [command]/usr/bin/git version
2025-08-21T23:27:03.7983223Z git version 2.51.0
2025-08-21T23:27:03.8008656Z ##[endgroup]
2025-08-21T23:27:03.8023049Z Temporarily overriding HOME='/home/runner/work/_temp/a0e27441-a183-4ef1-bf89-a39f486b3508' before making global git config changes
2025-08-21T23:27:03.8025592Z Adding repository directory to the temporary git global config as a safe directory
2025-08-21T23:27:03.8034559Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/games/games
2025-08-21T23:27:03.8067688Z Deleting the contents of '/home/runner/work/games/games'
2025-08-21T23:27:03.8071395Z ##[group]Initializing the repository
2025-08-21T23:27:03.8075099Z [command]/usr/bin/git init /home/runner/work/games/games
2025-08-21T23:27:03.8126846Z hint: Using 'master' as the name for the initial branch. This default branch name
2025-08-21T23:27:03.8129624Z hint: is subject to change. To configure the initial branch name to use in all
2025-08-21T23:27:03.8131532Z hint: of your new repositories, which will suppress this warning, call:
2025-08-21T23:27:03.8132784Z hint:
2025-08-21T23:27:03.8134112Z hint: 	git config --global init.defaultBranch <name>
2025-08-21T23:27:03.8135333Z hint:
2025-08-21T23:27:03.8136345Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2025-08-21T23:27:03.8138158Z hint: 'development'. The just-created branch can be renamed via this command:
2025-08-21T23:27:03.8139903Z hint:
2025-08-21T23:27:03.8140815Z hint: 	git branch -m <name>
2025-08-21T23:27:03.8141636Z hint:
2025-08-21T23:27:03.8142726Z hint: Disable this message with "git config set advice.defaultBranchName false"
2025-08-21T23:27:03.8144457Z Initialized empty Git repository in /home/runner/work/games/games/.git/
2025-08-21T23:27:03.8147148Z [command]/usr/bin/git remote add origin https://github.com/ameer00/games
2025-08-21T23:27:03.8174675Z ##[endgroup]
2025-08-21T23:27:03.8176955Z ##[group]Disabling automatic garbage collection
2025-08-21T23:27:03.8179082Z [command]/usr/bin/git config --local gc.auto 0
2025-08-21T23:27:03.8283772Z ##[endgroup]
2025-08-21T23:27:03.8285969Z ##[group]Setting up auth
2025-08-21T23:27:03.8293626Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2025-08-21T23:27:03.8298456Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2025-08-21T23:27:03.8502485Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2025-08-21T23:27:03.8531107Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2025-08-21T23:27:03.8750625Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2025-08-21T23:27:03.8786706Z ##[endgroup]
2025-08-21T23:27:03.8789217Z ##[group]Fetching the repository
2025-08-21T23:27:03.8798153Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +00a48aa299a814360abf92383a82dfb6fe3bf870:refs/remotes/origin/main
2025-08-21T23:27:04.1152151Z From https://github.com/ameer00/games
2025-08-21T23:27:04.1155832Z  * [new ref]         00a48aa299a814360abf92383a82dfb6fe3bf870 -> origin/main
2025-08-21T23:27:04.1184799Z ##[endgroup]
2025-08-21T23:27:04.1186870Z ##[group]Determining the checkout info
2025-08-21T23:27:04.1189144Z ##[endgroup]
2025-08-21T23:27:04.1192070Z [command]/usr/bin/git sparse-checkout disable
2025-08-21T23:27:04.1232350Z [command]/usr/bin/git config --local --unset-all extensions.worktreeConfig
2025-08-21T23:27:04.1261657Z ##[group]Checking out the ref
2025-08-21T23:27:04.1265082Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
2025-08-21T23:27:04.1313479Z Switched to a new branch 'main'
2025-08-21T23:27:04.1316585Z branch 'main' set up to track 'origin/main'.
2025-08-21T23:27:04.1322643Z ##[endgroup]
2025-08-21T23:27:04.1359363Z [command]/usr/bin/git log -1 --format=%H
2025-08-21T23:27:04.1382732Z 00a48aa299a814360abf92383a82dfb6fe3bf870
2025-08-21T23:27:04.1608608Z ##[group]Run actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
2025-08-21T23:27:04.1609115Z with:
2025-08-21T23:27:04.1609702Z   github-token: ***
2025-08-21T23:27:04.1611160Z   script: const { data: labels } = await github.rest.issues.listLabelsForRepo({
  owner: context.repo.owner,
  repo: context.repo.repo,
});
const labelNames = labels.map(label => label.name);
core.setOutput('available_labels', labelNames.join(','));
core.info(`Found ${labelNames.length} labels: ${labelNames.join(', ')}`);
return labelNames;
2025-08-21T23:27:04.1612657Z   debug: false
2025-08-21T23:27:04.1612953Z   user-agent: actions/github-script
2025-08-21T23:27:04.1613289Z   result-encoding: json
2025-08-21T23:27:04.1613570Z   retries: 0
2025-08-21T23:27:04.1613860Z   retry-exempt-status-codes: 400,401,403,404,422
2025-08-21T23:27:04.1614210Z ##[endgroup]
2025-08-21T23:27:04.4419802Z Found 7 labels: bug, documentation, duplicate, enhancement, feature, question, wontfix
2025-08-21T23:27:04.5311121Z ##[group]Run google-github-actions/run-gemini-cli@v0
2025-08-21T23:27:04.5311565Z with:
2025-08-21T23:27:04.5312053Z   gemini_api_key: ***
2025-08-21T23:27:04.5312566Z   settings: {
  "debug": false,
  "maxSessionTurns": 25,
  "coreTools": [
    "run_shell_command(echo)"
  ]
}
2025-08-21T23:27:04.5316804Z   prompt: ## Role

You are an issue triage assistant. Analyze the current GitHub issue
and identify the most appropriate existing labels. Use the available
tools to gather information; do not ask for information to be
provided.

## Steps

1. Review the available labels in the environment variable: "${AVAILABLE_LABELS}".
2. Review the issue title and body provided in the environment
   variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
3. Classify the issue by the appropriate labels from the available labels.
4. Output the appropriate labels for this issue in JSON format with explanation, for example:
   
   {"labels_to_set": ["kind/bug", "priority/p0"], "explanation": "This is a critical bug report affecting main functionality"}
   
5. If the issue cannot be classified using the available labels, output:
   
   {"labels_to_set": [], "explanation": "Unable to classify this issue with available labels"}
   

## Guidelines

- Only use labels that already exist in the repository
- Assign all applicable labels based on the issue content
- Reference all shell variables as "${VAR}" (with quotes and braces)
- Output only valid JSON format
- Do not include any explanation or additional text, just the JSON
2025-08-21T23:27:04.5321231Z env:
2025-08-21T23:27:04.5321483Z   GITHUB_TOKEN: 
2025-08-21T23:27:04.5321772Z   ISSUE_TITLE: Create Pacman
2025-08-21T23:27:04.5322252Z   ISSUE_BODY: Create a web based Pacman game using PixiJS framwork and run it on port 8080.
2025-08-21T23:27:04.5322758Z   ISSUE_NUMBER: 8
2025-08-21T23:27:04.5323048Z   REPOSITORY: ameer00/games
2025-08-21T23:27:04.5323556Z   AVAILABLE_LABELS: bug,documentation,duplicate,enhancement,feature,question,wontfix
2025-08-21T23:27:04.5324069Z ##[endgroup]
2025-08-21T23:27:04.5411042Z ##[group]Run mkdir -p .gemini/
2025-08-21T23:27:04.5411443Z �[36;1mmkdir -p .gemini/�[0m
2025-08-21T23:27:04.5411832Z �[36;1mecho "${SETTINGS}" > ".gemini/settings.json"�[0m
2025-08-21T23:27:04.5482634Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2025-08-21T23:27:04.5483081Z env:
2025-08-21T23:27:04.5483340Z   GITHUB_TOKEN: 
2025-08-21T23:27:04.5483654Z   ISSUE_TITLE: Create Pacman
2025-08-21T23:27:04.5484154Z   ISSUE_BODY: Create a web based Pacman game using PixiJS framwork and run it on port 8080.
2025-08-21T23:27:04.5484657Z   ISSUE_NUMBER: 8
2025-08-21T23:27:04.5484945Z   REPOSITORY: ameer00/games
2025-08-21T23:27:04.5485451Z   AVAILABLE_LABELS: bug,documentation,duplicate,enhancement,feature,question,wontfix
2025-08-21T23:27:04.5486175Z   SETTINGS: {
  "debug": false,
  "maxSessionTurns": 25,
  "coreTools": [
    "run_shell_command(echo)"
  ]
}
2025-08-21T23:27:04.5486701Z ##[endgroup]
2025-08-21T23:27:04.5624597Z ##[group]Run set -euo pipefail
2025-08-21T23:27:04.5624997Z �[36;1mset -euo pipefail�[0m
2025-08-21T23:27:04.5625297Z �[36;1m�[0m
2025-08-21T23:27:04.5625623Z �[36;1mVERSION_INPUT="${GEMINI_CLI_VERSION:-latest}"�[0m
2025-08-21T23:27:04.5625996Z �[36;1m�[0m
2025-08-21T23:27:04.5626478Z �[36;1mif [[ "${VERSION_INPUT}" == "latest" || "${VERSION_INPUT}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.-]+)?(\+[a-zA-Z0-9\.-]+)?$ ]]; then�[0m
2025-08-21T23:27:04.5627349Z �[36;1m  echo "Installing Gemini CLI from npm: @google/gemini-cli@${VERSION_INPUT}"�[0m
2025-08-21T23:27:04.5628038Z �[36;1m  npm install --silent --no-audit --prefer-offline --global @google/gemini-cli@"${VERSION_INPUT}"�[0m
2025-08-21T23:27:04.5628556Z �[36;1melse�[0m
2025-08-21T23:27:04.5629022Z �[36;1m  echo "Installing Gemini CLI from GitHub: github:google-gemini/gemini-cli#${VERSION_INPUT}"�[0m
2025-08-21T23:27:04.5629658Z �[36;1m  git clone https://github.com/google-gemini/gemini-cli.git�[0m
2025-08-21T23:27:04.5630086Z �[36;1m  cd gemini-cli�[0m
2025-08-21T23:27:04.5630802Z �[36;1m  git checkout "${VERSION_INPUT}"�[0m
2025-08-21T23:27:04.5631166Z �[36;1m  npm install�[0m
2025-08-21T23:27:04.5631467Z �[36;1m  npm run bundle�[0m
2025-08-21T23:27:04.5631890Z �[36;1m  npm install --silent --no-audit --prefer-offline --global .�[0m
2025-08-21T23:27:04.5632310Z �[36;1mfi�[0m
2025-08-21T23:27:04.5632608Z �[36;1mecho "Verifying installation:"�[0m
2025-08-21T23:27:04.5633023Z �[36;1mif command -v gemini >/dev/null 2>&1; then�[0m
2025-08-21T23:27:04.5633596Z �[36;1m  gemini --version || echo "Gemini CLI installed successfully (version command not available)"�[0m
2025-08-21T23:27:04.5634115Z �[36;1melse�[0m
2025-08-21T23:27:04.5634429Z �[36;1m  echo "Error: Gemini CLI not found in PATH"�[0m
2025-08-21T23:27:04.5634793Z �[36;1m  exit 1�[0m
2025-08-21T23:27:04.5635053Z �[36;1mfi�[0m
2025-08-21T23:27:04.5677292Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2025-08-21T23:27:04.5677701Z env:
2025-08-21T23:27:04.5677950Z   GITHUB_TOKEN: 
2025-08-21T23:27:04.5678244Z   ISSUE_TITLE: Create Pacman
2025-08-21T23:27:04.5678748Z   ISSUE_BODY: Create a web based Pacman game using PixiJS framwork and run it on port 8080.
2025-08-21T23:27:04.5679241Z   ISSUE_NUMBER: 8
2025-08-21T23:27:04.5679520Z   REPOSITORY: ameer00/games
2025-08-21T23:27:04.5680017Z   AVAILABLE_LABELS: bug,documentation,duplicate,enhancement,feature,question,wontfix
2025-08-21T23:27:04.5680728Z   GEMINI_CLI_VERSION: 
2025-08-21T23:27:04.5681022Z ##[endgroup]
2025-08-21T23:27:04.5744078Z Installing Gemini CLI from npm: @google/gemini-cli@latest
2025-08-21T23:27:22.3464193Z Verifying installation:
2025-08-21T23:27:23.6293876Z 0.1.22
2025-08-21T23:27:23.6449178Z ##[group]Run set -euo pipefail
2025-08-21T23:27:23.6449509Z �[36;1mset -euo pipefail�[0m
2025-08-21T23:27:23.6449723Z �[36;1m�[0m
2025-08-21T23:27:23.6449920Z �[36;1m# Unset GEMINI_API_KEY if empty�[0m
2025-08-21T23:27:23.6450462Z �[36;1mif [ -z "${GEMINI_API_KEY}" ]; then�[0m
2025-08-21T23:27:23.6450747Z �[36;1m  unset GEMINI_API_KEY�[0m
2025-08-21T23:27:23.6450996Z �[36;1mfi�[0m
2025-08-21T23:27:23.6451171Z �[36;1m�[0m
2025-08-21T23:27:23.6451463Z �[36;1m# Create a temporary directory for storing the output, and ensure it's�[0m
2025-08-21T23:27:23.6451830Z �[36;1m# cleaned up later�[0m
2025-08-21T23:27:23.6452141Z �[36;1mTEMP_OUTPUT="$(mktemp -p "${RUNNER_TEMP}" gemini.XXXXXXXXXX)"�[0m
2025-08-21T23:27:23.6452508Z �[36;1mfunction cleanup {�[0m
2025-08-21T23:27:23.6452760Z �[36;1m  rm -f "${TEMP_OUTPUT}"�[0m
2025-08-21T23:27:23.6453004Z �[36;1m}�[0m
2025-08-21T23:27:23.6453178Z �[36;1mtrap cleanup EXIT�[0m
2025-08-21T23:27:23.6453374Z �[36;1m�[0m
2025-08-21T23:27:23.6453578Z �[36;1m# Run Gemini CLI with the provided prompt�[0m
2025-08-21T23:27:23.6453956Z �[36;1mif ! gemini --yolo --prompt "${PROMPT}" &> "${TEMP_OUTPUT}"; then�[0m
2025-08-21T23:27:23.6454320Z �[36;1m  GEMINI_RESPONSE="$(cat "${TEMP_OUTPUT}")"�[0m
2025-08-21T23:27:23.6454670Z �[36;1m  FIRST_LINE="$(echo "${GEMINI_RESPONSE}" | head -n1)"�[0m
2025-08-21T23:27:23.6455060Z �[36;1m  echo "::error title=Gemini CLI execution failed::${FIRST_LINE}"�[0m
2025-08-21T23:27:23.6455402Z �[36;1m  echo "${GEMINI_RESPONSE}"�[0m
2025-08-21T23:27:23.6455639Z �[36;1m  exit 1�[0m
2025-08-21T23:27:23.6455809Z �[36;1mfi�[0m
2025-08-21T23:27:23.6455972Z �[36;1m�[0m
2025-08-21T23:27:23.6456178Z �[36;1mGEMINI_RESPONSE="$(cat "${TEMP_OUTPUT}")"�[0m
2025-08-21T23:27:23.6456448Z �[36;1m�[0m
2025-08-21T23:27:23.6456833Z �[36;1m# Print the response�[0m
2025-08-21T23:27:23.6457133Z �[36;1mecho "::group::Gemini response"�[0m
2025-08-21T23:27:23.6457400Z �[36;1mecho "${GEMINI_RESPONSE}"�[0m
2025-08-21T23:27:23.6457642Z �[36;1mecho "::endgroup::"�[0m
2025-08-21T23:27:23.6457841Z �[36;1m�[0m
2025-08-21T23:27:23.6458105Z �[36;1m# Set the captured response as a step output, supporting multiline�[0m
2025-08-21T23:27:23.6458501Z �[36;1mecho "gemini_response<<EOF" >> "${GITHUB_OUTPUT}"�[0m
2025-08-21T23:27:23.6458839Z �[36;1mecho "${GEMINI_RESPONSE}" >> "${GITHUB_OUTPUT}"�[0m
2025-08-21T23:27:23.6459268Z �[36;1mecho "EOF" >> "${GITHUB_OUTPUT}"�[0m
2025-08-21T23:27:23.6501625Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2025-08-21T23:27:23.6501949Z env:
2025-08-21T23:27:23.6502120Z   GITHUB_TOKEN: 
2025-08-21T23:27:23.6502317Z   ISSUE_TITLE: Create Pacman
2025-08-21T23:27:23.6502687Z   ISSUE_BODY: Create a web based Pacman game using PixiJS framwork and run it on port 8080.
2025-08-21T23:27:23.6503093Z   ISSUE_NUMBER: 8
2025-08-21T23:27:23.6503293Z   REPOSITORY: ameer00/games
2025-08-21T23:27:23.6503687Z   AVAILABLE_LABELS: bug,documentation,duplicate,enhancement,feature,question,wontfix
2025-08-21T23:27:23.6504422Z   GEMINI_API_KEY: ***
2025-08-21T23:27:23.6504621Z   SURFACE: GitHub
2025-08-21T23:27:23.6504810Z   GOOGLE_CLOUD_PROJECT: 
2025-08-21T23:27:23.6505020Z   GOOGLE_CLOUD_LOCATION: 
2025-08-21T23:27:23.6505225Z   GOOGLE_GENAI_USE_VERTEXAI: 
2025-08-21T23:27:23.6505441Z   GOOGLE_GENAI_USE_GCA: 
2025-08-21T23:27:23.6505641Z   GOOGLE_CLOUD_ACCESS_TOKEN: 
2025-08-21T23:27:23.6509206Z   PROMPT: ## Role

You are an issue triage assistant. Analyze the current GitHub issue
and identify the most appropriate existing labels. Use the available
tools to gather information; do not ask for information to be
provided.

## Steps

1. Review the available labels in the environment variable: "${AVAILABLE_LABELS}".
2. Review the issue title and body provided in the environment
   variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
3. Classify the issue by the appropriate labels from the available labels.
4. Output the appropriate labels for this issue in JSON format with explanation, for example:
   
   {"labels_to_set": ["kind/bug", "priority/p0"], "explanation": "This is a critical bug report affecting main functionality"}
   
5. If the issue cannot be classified using the available labels, output:
   
   {"labels_to_set": [], "explanation": "Unable to classify this issue with available labels"}
   

## Guidelines

- Only use labels that already exist in the repository
- Assign all applicable labels based on the issue content
- Reference all shell variables as "${VAR}" (with quotes and braces)
- Output only valid JSON format
- Do not include any explanation or additional text, just the JSON
2025-08-21T23:27:23.6513132Z ##[endgroup]
2025-08-21T23:27:35.1187224Z ##[group]Gemini response
2025-08-21T23:27:35.1187520Z Data collection is disabled.
2025-08-21T23:27:35.1188527Z I will act as an issue triage assistant. I will begin by reading the `AVAILABLE_LABELS`, `ISSUE_TITLE`, and `ISSUE_BODY` environment variables to gather the necessary information for classifying the issue.
2025-08-21T23:27:35.1189540Z {"labels_to_set": ["feature"], "explanation": "This issue proposes adding a new game, which is a new feature."}
2025-08-21T23:27:35.1189977Z 
2025-08-21T23:27:35.1190544Z ##[endgroup]
2025-08-21T23:27:35.1282274Z ##[group]Run actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
2025-08-21T23:27:35.1282648Z with:
2025-08-21T23:27:35.1283006Z   github-token: ***
2025-08-21T23:27:35.1286680Z   script: // Strip code block markers if present
const rawLabels = process.env.LABELS_OUTPUT;
core.info(`Raw labels JSON: ${rawLabels}`);
let parsedLabels;
try {
  const trimmedLabels = rawLabels.replace(/^(?:json)?\s*/, '').replace(/\s*$/, '').trim();
  parsedLabels = JSON.parse(trimmedLabels);
  core.info(`Parsed labels JSON: ${JSON.stringify(parsedLabels)}`);
} catch (err) {
  core.setFailed(`Failed to parse labels JSON from Gemini output: ${err.message}\nRaw output: ${rawLabels}`);
  return;
}

const issueNumber = parseInt(process.env.ISSUE_NUMBER);

// Set labels based on triage result
if (parsedLabels.labels_to_set && parsedLabels.labels_to_set.length > 0) {
  await github.rest.issues.setLabels({
    owner: context.repo.owner,
    repo: context.repo.repo,
    issue_number: issueNumber,
    labels: parsedLabels.labels_to_set
  });
  const explanation = parsedLabels.explanation ? ` - ${parsedLabels.explanation}` : '';
  core.info(`Successfully set labels for #${issueNumber}: ${parsedLabels.labels_to_set.join(', ')}${explanation}`);
} else {
  // If no labels to set, leave the issue as is
  const explanation = parsedLabels.explanation ? ` - ${parsedLabels.explanation}` : '';
  core.info(`No labels to set for #${issueNumber}, leaving as is${explanation}`);
}
2025-08-21T23:27:35.1291000Z   debug: false
2025-08-21T23:27:35.1291201Z   user-agent: actions/github-script
2025-08-21T23:27:35.1291437Z   result-encoding: json
2025-08-21T23:27:35.1291638Z   retries: 0
2025-08-21T23:27:35.1291836Z   retry-exempt-status-codes: 400,401,403,404,422
2025-08-21T23:27:35.1292095Z env:
2025-08-21T23:27:35.1292262Z   REPOSITORY: ameer00/games
2025-08-21T23:27:35.1292458Z   ISSUE_NUMBER: 8
2025-08-21T23:27:35.1293594Z   LABELS_OUTPUT: Data collection is disabled.
I will act as an issue triage assistant. I will begin by reading the `AVAILABLE_LABELS`, `ISSUE_TITLE`, and `ISSUE_BODY` environment variables to gather the necessary information for classifying the issue.
{"labels_to_set": ["feature"], "explanation": "This issue proposes adding a new game, which is a new feature."}

2025-08-21T23:27:35.1294763Z ##[endgroup]
2025-08-21T23:27:35.2122658Z Raw labels JSON: Data collection is disabled.
2025-08-21T23:27:35.2124292Z I will act as an issue triage assistant. I will begin by reading the `AVAILABLE_LABELS`, `ISSUE_TITLE`, and `ISSUE_BODY` environment variables to gather the necessary information for classifying the issue.
2025-08-21T23:27:35.2126180Z {"labels_to_set": ["feature"], "explanation": "This issue proposes adding a new game, which is a new feature."}
2025-08-21T23:27:35.2126971Z 
2025-08-21T23:27:35.2152747Z ##[error]Failed to parse labels JSON from Gemini output: Unexpected token 'D', "Data colle"... is not valid JSON
Raw output: Data collection is disabled.
I will act as an issue triage assistant. I will begin by reading the `AVAILABLE_LABELS`, `ISSUE_TITLE`, and `ISSUE_BODY` environment variables to gather the necessary information for classifying the issue.
{"labels_to_set": ["feature"], "explanation": "This issue proposes adding a new game, which is a new feature."}

2025-08-21T23:27:35.2354384Z Post job cleanup.
2025-08-21T23:27:35.2422520Z Post job cleanup.
2025-08-21T23:27:35.3346823Z [command]/usr/bin/git version
2025-08-21T23:27:35.3383523Z git version 2.51.0
2025-08-21T23:27:35.3427242Z Temporarily overriding HOME='/home/runner/work/_temp/8249ca70-54b4-4261-873a-3550cdb72aef' before making global git config changes
2025-08-21T23:27:35.3428653Z Adding repository directory to the temporary git global config as a safe directory
2025-08-21T23:27:35.3433987Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/games/games
2025-08-21T23:27:35.3469919Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2025-08-21T23:27:35.3502920Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2025-08-21T23:27:35.3736615Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2025-08-21T23:27:35.3758721Z http.https://github.com/.extraheader
2025-08-21T23:27:35.3772514Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2025-08-21T23:27:35.3803667Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2025-08-21T23:27:35.4127131Z Cleaning up orphan processes

Additional information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions