name: "Issue: Needs Repro"

on:
  issues:
    types: [ labeled ]

concurrency:
  group: issue-needs-repro-${{ github.event.issue.number }}
  cancel-in-progress: false

jobs:
  reply-labeled:
    if: github.repository == 'withastro/astro'
    runs-on: depot-ubuntu-24.04-arm-small
    steps:
      - name: Remove triaging label
        if: >-
          github.event_name == 'issues' &&
          contains(github.event.issue.labels.*.name, 'triage: needs reproduction')
        env:
          GH_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
          ISSUE_NUMBER: ${{ github.event.issue.number }}
          REPO: ${{ github.repository }}
        run: |
          gh issue comment "$ISSUE_NUMBER" --repo "$REPO" --body "Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new/repro). Issues marked with `triage: needs reproduction` will be closed if they have no activity within 3 days."

          gh issue edit "$ISSUE_NUMBER" --repo "$REPO" --remove-label "triage: needs triage"
