diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 18ae4a1..d0180a9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -32,18 +32,15 @@ body: validations: required: true - - type: dropdown + - type: checkboxes id: platforms attributes: label: Affected Platforms - description: Select all platforms where you experience this issue. - multiple: true options: - - iOS - - Android - - Web - validations: - required: true + - label: iOS + - label: Android + - label: Web + - label: Other - type: input id: library-version @@ -79,11 +76,9 @@ body: - type: input id: reproducible-example attributes: - label: Reproduction Repository - description: | - **A minimal reproduction is required.** Provide a link to a GitHub repository or Expo Snack. - Issues without reproductions may be closed and labeled as `needs-repro`. - placeholder: https://github.com/username/repo or https://snack.expo.dev/... + label: Repro + description: A link to a GitHub repository, Expo Snack, CodeSandbox, or StackBlitz. + placeholder: https://github.com/username/repo validations: required: true diff --git a/.github/workflows/check-repro.yml b/.github/workflows/check-repro.yml index 6f783cb..948f5a2 100644 --- a/.github/workflows/check-repro.yml +++ b/.github/workflows/check-repro.yml @@ -27,6 +27,13 @@ jobs: const user = comment ? comment.user.login : author; const body = comment ? comment.body : issue.body || ''; + // Extract the reproduction field from the issue body + const reproFieldMatch = body.match(/### Repro\s+([\s\S]*?)(?=###|$)/i); + const reproField = reproFieldMatch ? reproFieldMatch[1].trim() : ''; + + // Skip if repro field is empty, n/a, or similar + const invalidRepro = /^(n\/?a|none|no|nothing|-|\.+)?$/i.test(reproField); + // Only accept repos owned by the issue author or commenter const reproPatterns = [ new RegExp(`https?://github\\.com/${user}/[^/\\s]+/?`, 'i'), @@ -35,7 +42,8 @@ jobs: new RegExp(`https?://stackblitz\\.com/[^\\s]+`, 'i'), ]; - const hasRepro = reproPatterns.some(pattern => pattern.test(body)); + // Check repro field specifically, not the entire body + const hasRepro = !invalidRepro && reproPatterns.some(pattern => pattern.test(reproField)); const labels = issue.labels.map(l => l.name); const hasNeedsReproLabel = labels.includes('needs repro'); const hasReproProvidedLabel = labels.includes('repro provided'); @@ -71,7 +79,21 @@ jobs: }); } } else { - // No valid repro - only act on issue events, not comments + // No valid repro - remove repro provided label if present + if (hasReproProvidedLabel) { + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + name: 'repro provided' + }); + } catch (e) { + if (!e.message.includes('Label does not exist')) throw e; + } + } + + // Only post warning comment on issue events, not comments if (context.eventName !== 'issues') { return; }