Skip to content

Bug Report Reproduction Check #6

Bug Report Reproduction Check

Bug Report Reproduction Check #6

# 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: 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: |
Given a bug report title and text for a web application, return 'pass' if there is enough information to reliably reproduce the issue,
meaning the report clearly describes the steps to reproduce the problem, specifies the expected and actual behavior, and includes environment details such as browser and operating system;
if any of these elements are missing or unclear, return a brief description of what is missing in a friendly response to the author instead of 'pass'.
Consider the following title and body:
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
})