From e71e5eaa433a6368317091e6f05899774c7e87d3 Mon Sep 17 00:00:00 2001 From: Yulong Han Date: Fri, 26 Dec 2025 17:06:47 +0800 Subject: [PATCH] refactor: update GitHub workflows and labeler configuration --- .github/labeler.yml | 4 - .github/workflows/issue-labeler.yml | 7 +- .github/workflows/labeler.yml | 121 +++++++++++++--------------- 3 files changed, 59 insertions(+), 73 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index d7b6a02d..8ac3822c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -13,7 +13,3 @@ riscv64: x86_64: - changed-files: - any-glob-to-any-file: src/arch/x86_64/**/* - - - - diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml index 4f542926..11599e3f 100644 --- a/.github/workflows/issue-labeler.yml +++ b/.github/workflows/issue-labeler.yml @@ -39,11 +39,6 @@ jobs: labels.push('documentation'); } - // CI/CD - if (title.includes('ci') || body.includes('ci')) { - labels.push('ci'); - } - // Architecture specific if (title.includes('aarch64') || body.includes('aarch64')) { labels.push('aarch64'); @@ -107,4 +102,4 @@ jobs: issue_number, labels }); - } \ No newline at end of file + } diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 9d48a3d4..441b43b3 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,70 +1,65 @@ --- - name: Pull Request Labeler - - on: - pull_request_target: - - jobs: - triage: - name: Label triage - permissions: - contents: read - pull-requests: write - issues: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v5 - with: - sync-labels: true - - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const title = context.payload.pull_request.title.toLowerCase(); - const labels = []; - - if (title.includes('feat') || title.includes('feature')) { - labels.push('feature'); - } - - if (title.includes('fix') || title.includes('bug')) { - labels.push('bug'); - } - - if (title.includes('docs') || title.includes('documentation')) { - labels.push('documentation'); - } +name: Pull Request Labeler - if (title.includes('ci')) { - labels.push('ci'); - } +on: + pull_request_target: - if (title.includes('aarch64')) { - labels.push('aarch64'); - } +jobs: + triage: + name: Label triage + permissions: + contents: read + pull-requests: write + issues: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + with: + sync-labels: true + - uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const title = context.payload.pull_request.title.toLowerCase(); + const labels = []; + + if (title.includes('feat') || title.includes('feature')) { + labels.push('feature'); + } + + if (title.includes('fix') || title.includes('bug')) { + labels.push('bug'); + } + + if (title.includes('docs') || title.includes('documentation')) { + labels.push('documentation'); + } - if (title.includes('loongarch64')) { - labels.push('loongarch64'); - } + if (title.includes('aarch64')) { + labels.push('aarch64'); + } - if (title.includes('riscv64')) { - labels.push('riscv64'); - } + if (title.includes('loongarch64')) { + labels.push('loongarch64'); + } - if (title.includes('x86_64')) { - labels.push('x86_64'); - } - - const pr_number = context.payload.pull_request?.number; - console.log(`PR number: ${pr_number}`); - console.log(`Computed labels: ${labels}`); + if (title.includes('riscv64')) { + labels.push('riscv64'); + } + + if (title.includes('x86_64')) { + labels.push('x86_64'); + } + + const pr_number = context.payload.pull_request?.number; + console.log(`PR number: ${pr_number}`); + console.log(`Computed labels: ${labels}`); - if (pr_number && labels.length > 0) { - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr_number, - labels: labels - }); - } - \ No newline at end of file + if (pr_number && labels.length > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr_number, + labels: labels + }); + }