Skip to content

cssnr/ai-issue-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Tag Major GitHub Tag Minor GitHub Release Version GitHub Dist Size Action Run Using Workflow Release Workflow Lint Quality Gate Status GitHub Last Commit GitHub Repo Size GitHub Top Language GitHub Contributors GitHub Issues GitHub Discussions GitHub Forks GitHub Repo Stars GitHub Org Stars Discord Ko-fi

AI Issue Action

AI Issue Action

🤖 Automatically triage issues with AI trained on your existing documentation.

💯 100% free to use with OpenCode Zen or Gemini Free Tier models.

✅ Works with Claude, Gemini, OpenAI, and any OpenAI Compatible Provider.

- name: 'AI Issue'
  uses: cssnr/ai-issue-action@v1
  with:
    model: big-pickle
    instructions: 'You are a helpful assistant responding to a GitHub Issue'

💡 You can copy the issue.yaml to your workflows or see more Examples.

Features

  • Works with Claude, Gemini, OpenAI, and OpenAI Compatible Provider
  • Provide Instructions via Text, Path Globs or URL
  • Add Custom Head or Tail Message to the Issue Reply
  • Outputs Results, Reasoning, Usage, and Comment Details
  • Built with the AI SDK

Tip

TO see more features, please submit a feature request.

Inputs

The only required input is the model name.
You must provide at least one of instructions, url or path.

Input Default Input Description
model - Model to Use
instructions - Text Instructions
url - Remote URL Instructions
path - Path(s) Glob Instructions
max_tokens - Max Output Tokens
head - Head Text for Reply
tail - Tail Text for Reply
base_url https://opencode.ai/zen/v1 URL for OpenAI Compatible
number Workflow Issue Number Issue Number
token ${{ github.token }} Optional GitHub Token

To authenticate provide your API key in the applicable environment variable:

  • Claude: ANTHROPIC_API_KEY
  • Gemini: GOOGLE_GENERATIVE_AI_API_KEY
  • OpenAI: OPENAI_API_KEY
  • OpenAI Compatible: PROVIDER_API_KEY
- name: 'AI Issue'
  uses: cssnr/ai-issue-action@v1
  env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
    OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
    PROVIDER_API_KEY: ${{ secrets.PROVIDER_API_KEY }} # optional for free models
  with:
    model: gemini-2.5-flash # or any Claude, Gemini, OpenAI, or OpenAI Compatible Provider

💡 Start for free with model big-pickle (no API key required).

Make sure your workflow has the required permissions.

permissions:
  contents: write
  issues: write

model

Provider routing is based on model name.

Pattern Provider SDK
gemini* @ai-sdk/google
gpt* @ai-sdk/openai
claude* @ai-sdk/anthropic
* @ai-sdk/openai-compatible

Examples: claude-haiku-4-5, gemini-2.5-flash, gpt-5.4-nano, big-pickle

instructions

Text instruction.

Example: You are a helpful assistant responding to a GitHub Issue on training data:

url

URL to fetch remote instructions.

Example: https://smashedr.github.io/vitepress-chat/llms.txt

path

File glob(s) to read for instructions.

Example: .github/instructions/*.md

Examples

💡 To get started 100% free, copy the issue.yaml to your workflows.

Basic example using the free Zen Big Pickle model.

- name: 'AI Issue'
  uses: cssnr/ai-issue-action@v1
  with:
    model: big-pickle
    instructions: 'You are an assistant responding to a GitHub Issue'

Use remote llms.txt and Gemini Free Tier.

- name: 'AI Issue'
  uses: cssnr/ai-issue-action@v1
  env:
    GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
  with:
    model: gemini-2.5-flash
    instructions: 'You are an assistant responding to a GitHub Issue with knowledge:'
    url: https://smashedr.github.io/vitepress-chat/llms.txt

Full example using an app token and file path globs.

name: 'Issue'

on:
  issues:
    types: [opened]

jobs:
  issue:
    name: 'Issue'
    runs-on: ubuntu-latest
    timeout-minutes: 15

    permissions:
      contents: write
      issues: write

    steps:
      - name: 'Checkout'
        uses: actions/checkout@v6
        with:
          sparse-checkout-cone-mode: false
          sparse-checkout: |
            docs/**

      - name: 'Create App Token'
        if: ${{ !github.event.release.prerelease }}
        id: app
        uses: actions/create-github-app-token@v3
        with:
          client-id: ${{ vars.APP_CLIENT_ID }}
          private-key: ${{ secrets.APP_PRIVATE_KEY }}

      - name: 'AI Issue'
        id: issue
        uses: cssnr/ai-issue-action@v1
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        with:
          token: ${{ steps.app.outputs.token }}
          model: gpt-5.4-nano
          instructions: 'You are an assistant responding to a GitHub Issue with Training Data:'
          path: |
            docs/**/*.md
          tail: |
            _Response generated by the [AI Issue Action](https://github.com/cssnr/ai-issue-action)._

Only run for issues with the label bug.

if: ${{ contains(github.event.issue.labels.*.name, 'bug') }}

Only run for issues without the label enhancement.

if: ${{ !contains(github.event.issue.labels.*.name, 'enhancement') }}

Only run for issues without a label or with label bug.

if: ${{ !github.event.issue.labels[0] || contains(github.event.issue.labels.*.name, 'bug') }}

Only run for issues without a type or the type bug (Organizations).

if: ${{ !github.event.issue.type || github.event.issue.type.name == 'Bug' }}

For more examples, you can check out other projects using this action:
https://github.com/cssnr/ai-issue-action/network/dependents

Outputs

Output Description
text Response Text
reasoningText Reasoning Text
usage Usage JSON
finishReason Finish Reason
comment Comment JSON
commentId Comment ID
commentUrl Comment URL
- name: 'AI Issue'
  id: issue
  uses: cssnr/ai-issue-action@v1
  env:
    GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
  with:
    model: gemini-2.5-flash
    instructions: 'You are an assistant responding to a GitHub Issue with Training Data:'
    path: .github/instructions/*.md

- name: 'Echo Outputs'
  env:
    text: ${{ steps.issue.outputs.text }}
    reasoningText: ${{ steps.issue.outputs.reasoningText }}
    usage: ${{ steps.issue.outputs.usage }}
    comment: ${{ steps.issue.outputs.comment }}
  run: |
    echo "text: ${text}"
    echo "reasoningText: ${reasoningText}"
    echo "usage: ${usage}"
    echo "finishReason: ${{ steps.issue.outputs.finishReason }}"
    echo "comment: ${comment}"
    echo "commentId: ${{ steps.issue.outputs.commentId }}"
    echo "commentUrl: ${{ steps.issue.outputs.commentUrl }}"

Note: Multi-line outputs get evaluated using ${{ }} in a run block.

Tags

The following rolling tags are maintained.

Version Tag Rolling Bugs Feat. Name Target Example
GitHub Tag Major Major vN.x.x vN
GitHub Tag Minor Minor vN.N.x vN.N
GitHub Release Micro vN.N.N vN.N.N

You can view the release notes for each version on the releases page.

The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.

Support

If you run into any issues or need help getting started, please do one of the following:

Features Issues Discussions Discord

Contributing

If you would like to submit a PR, please review the CONTRIBUTING.md.

Please consider making a donation to support the development of this project and additional open source projects.

Ko-fi

Actions Tools

Additionally, you can support other GitHub Actions I have published:

❔ Unpublished Actions

These actions are not published on the Marketplace, but may be useful.


📝 Template Actions

These are basic action templates that I use for creating new actions.

Note: The docker-test-action builds, runs and pushes images to GitHub Container Registry.


For a full list of current projects visit: https://cssnr.github.io/

Star History Chart

About

Automatically triage issues with AI trained on your existing documentation. Free to use with any provider you choose.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors