Skip to content

Bug Report Reproduction Check #12

Bug Report Reproduction Check

Bug Report Reproduction Check #12

# This workflow will trigger when a new issue is opened in the repository.
# It checks if the issue is labeled as a bug and analyzes the issue content
# to determine if it contains enough information to reproduce the bug.
# If the issue does not provide sufficient information, it will comment on the issue
# with a friendly message asking for more details.
# Default model: mistral-ai/ministral-3b can be changed inline.
name: Bug Report Reproduction Check
on:
issues:
types: [labeled]
permissions:
contents: read
issues: write
models: read
jobs:
reproduction-steps-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch Issue
id: issue
uses: actions/github-script@v7
with:
script: |
const issue_number = context.issue.number
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number
})
core.setOutput('title', issue.data.title)
core.setOutput('body', issue.data.body)
- name: Analyze Issue For Reproduction
if: contains(join(github.event.issue.labels.*.name, ','), 'bug')
id: analyze-issue
uses: actions/ai-inference@v1
with:
model: mistral-ai/ministral-3b
system-prompt-file: './.github/workflows/prompts/bug-reproduction-requirements.txt'
prompt: |
Title: ${{ steps.issue.outputs.title }}
Body: ${{ steps.issue.outputs.body }}
- name: Comment On Issue
if: contains(join(github.event.issue.labels.*.name, ','), 'bug') && steps.analyze-issue.outputs.response != 'pass'
uses: actions/github-script@v7
env:
AI_RESPONSE: ${{ steps.analyze-issue.outputs.response }}
with:
script: |
const issue_number = context.issue.number
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number,
body: process.env.AI_RESPONSE
})