summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorCYFS <[email protected]>2026-07-28 13:14:17 +0800
committerGitHub <[email protected]>2026-07-28 13:14:17 +0800
commit1edc46af3e15355d418135b2b93820452ca8258e (patch)
treee009b2409d575458989f9e4c9863713a6937aad1 /.github/workflows
parenta7b0182817059620738779b30f43eaeca10627ff (diff)
[ci][issue] Add issue automation workflows#11661
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/issue_automation_tests.yml50
-rw-r--r--.github/workflows/issue_claim.yml34
-rw-r--r--.github/workflows/issue_labeler.yml30
-rw-r--r--.github/workflows/similar_issues.yml30
-rw-r--r--.github/workflows/similar_issues_backfill.yml48
5 files changed, 192 insertions, 0 deletions
diff --git a/.github/workflows/issue_automation_tests.yml b/.github/workflows/issue_automation_tests.yml
new file mode 100644
index 0000000000..479ab12c65
--- /dev/null
+++ b/.github/workflows/issue_automation_tests.yml
@@ -0,0 +1,50 @@
+name: Issue Automation Tests
+
+on:
+ push:
+ branches: [master]
+ paths:
+ - ".github/ISSUE_TEMPLATE/bug_report.yml"
+ - ".github/ISSUE_TEMPLATE/feature_request.yml"
+ - ".github/workflows/issue_*.yml"
+ - ".github/workflows/similar_issues*.yml"
+ - "tools/ci/issue_*.py"
+ - "tools/ci/similar_issues.py"
+ - "tools/ci/test_issue_*.py"
+ - "tools/ci/test_similar_issues.py"
+ pull_request:
+ branches: [master]
+ paths:
+ - ".github/ISSUE_TEMPLATE/bug_report.yml"
+ - ".github/ISSUE_TEMPLATE/feature_request.yml"
+ - ".github/workflows/issue_*.yml"
+ - ".github/workflows/similar_issues*.yml"
+ - "tools/ci/issue_*.py"
+ - "tools/ci/similar_issues.py"
+ - "tools/ci/test_issue_*.py"
+ - "tools/ci/test_similar_issues.py"
+
+concurrency:
+ group: issue-automation-tests-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ test:
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - name: Run issue automation tests
+ working-directory: tools/ci
+ run: >-
+ python3 -m unittest
+ test_issue_labeler.py
+ test_issue_claim.py
+ test_similar_issues.py
diff --git a/.github/workflows/issue_claim.yml b/.github/workflows/issue_claim.yml
new file mode 100644
index 0000000000..e4f9fd5b56
--- /dev/null
+++ b/.github/workflows/issue_claim.yml
@@ -0,0 +1,34 @@
+name: Issue Claim
+
+on:
+ issue_comment:
+ types: [created]
+
+concurrency:
+ group: issue-claim-${{ github.repository_id }}-${{ github.event.issue.number }}
+ queue: max
+
+permissions: {}
+
+jobs:
+ issue-claim:
+ if: >-
+ github.event.issue.pull_request == null &&
+ github.event.comment.user.type != 'Bot' &&
+ (github.event.comment.body == '/claim' ||
+ github.event.comment.body == '/unclaim')
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ permissions:
+ contents: read
+ issues: write
+ steps:
+ - name: Checkout trusted workflow code
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - name: Handle issue command
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: python3 tools/ci/issue_claim.py
diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml
new file mode 100644
index 0000000000..f40811299b
--- /dev/null
+++ b/.github/workflows/issue_labeler.yml
@@ -0,0 +1,30 @@
+name: Issue Labeler
+
+on:
+ issues:
+ types: [opened, edited, reopened]
+
+concurrency:
+ group: issue-labeler-${{ github.repository_id }}-${{ github.event.issue.number }}
+ cancel-in-progress: true
+
+permissions: {}
+
+jobs:
+ label:
+ if: ${{ github.event.issue.pull_request == null }}
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ permissions:
+ contents: read
+ issues: write
+ steps:
+ - name: Checkout trusted workflow code
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - name: Add issue labels
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: python3 tools/ci/issue_labeler.py
diff --git a/.github/workflows/similar_issues.yml b/.github/workflows/similar_issues.yml
new file mode 100644
index 0000000000..84fb0f0516
--- /dev/null
+++ b/.github/workflows/similar_issues.yml
@@ -0,0 +1,30 @@
+name: Suggest Similar Issues
+
+on:
+ issues:
+ types: [opened]
+
+concurrency:
+ group: similar-issues-${{ github.repository_id }}-${{ github.event.issue.number }}
+ cancel-in-progress: true
+
+permissions: {}
+
+jobs:
+ suggest:
+ if: ${{ github.event.issue.pull_request == null }}
+ runs-on: ubuntu-22.04
+ timeout-minutes: 5
+ permissions:
+ contents: read
+ issues: write
+ steps:
+ - name: Checkout trusted workflow code
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - name: Suggest related issues
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: python3 tools/ci/similar_issues.py
diff --git a/.github/workflows/similar_issues_backfill.yml b/.github/workflows/similar_issues_backfill.yml
new file mode 100644
index 0000000000..7ba7c8e446
--- /dev/null
+++ b/.github/workflows/similar_issues_backfill.yml
@@ -0,0 +1,48 @@
+name: Backfill Similar Issues
+
+on:
+ workflow_dispatch:
+ inputs:
+ dry_run:
+ description: Log suggestions without posting comments
+ required: true
+ default: true
+ type: boolean
+ max_issues:
+ description: Maximum open unassigned issues to inspect (1-50)
+ required: true
+ default: "20"
+ type: string
+ search_delay_seconds:
+ description: Delay between GitHub searches (2-30 seconds)
+ required: true
+ default: "3"
+ type: string
+
+concurrency:
+ group: similar-issues-backfill
+ cancel-in-progress: false
+
+permissions: {}
+
+jobs:
+ backfill:
+ runs-on: ubuntu-22.04
+ timeout-minutes: 55
+ permissions:
+ contents: read
+ issues: write
+ steps:
+ - name: Checkout trusted workflow code
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - name: Inspect recent open issues
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ BACKFILL: "true"
+ DRY_RUN: ${{ inputs.dry_run }}
+ MAX_ISSUES: ${{ inputs.max_issues }}
+ SEARCH_DELAY_SECONDS: ${{ inputs.search_delay_seconds }}
+ run: python3 tools/ci/similar_issues.py