diff --git a/.github/prompts/issue-deduplicator.txt b/.github/prompts/issue-deduplicator.txt index 854e3c44..9bdd3af9 100644 --- a/.github/prompts/issue-deduplicator.txt +++ b/.github/prompts/issue-deduplicator.txt @@ -5,7 +5,7 @@ You will receive the following JSON files located in the current working directo - `codex-existing-issues.json`: JSON array of recent issues (each element includes number, title, body, createdAt). Instructions: -- Load both files as JSON and review their contents carefully. +- Load both files as JSON and review their contents carefully. The codex-existing-issues.json file is large, ensure you explore all of it. - Compare the current issue against the existing issues to find up to five that appear to describe the same underlying problem or request. - Only consider an issue a potential duplicate if there is a clear overlap in symptoms, feature requests, reproduction steps, or error messages. - Prioritize newer issues when similarity is comparable. @@ -16,4 +16,3 @@ Output requirements: - Respond with a JSON array of issue numbers (integers), ordered from most likely duplicate to least. - Include at most five numbers. - If you find no plausible duplicates, respond with `[]`. -- Do not emit any additional commentary, text, or keys beyond the JSON array. diff --git a/.github/workflows/issue-deduplicator.yml b/.github/workflows/issue-deduplicator.yml index a290adf7..b76f6176 100644 --- a/.github/workflows/issue-deduplicator.yml +++ b/.github/workflows/issue-deduplicator.yml @@ -73,6 +73,11 @@ jobs: return; } + if (numbers.length === 0) { + core.info('Codex reported no potential duplicates.'); + return; + } + const lines = ['Potential duplicates detected:', ...numbers.map((value) => `- #${value}`)]; await github.rest.issues.createComment({ @@ -86,6 +91,7 @@ jobs: if: ${{ always() && github.event.action == 'labeled' && github.event.label.name == 'codex-deduplicate' }} env: GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} run: | gh issue edit "${{ github.event.issue.number }}" --remove-label codex-deduplicate || true echo "Attempted to remove label: codex-deduplicate"