From e1514415463735f2b722cf5eb1f2a69ab5c4c584 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 15:24:01 +0800 Subject: [PATCH 01/10] chore: add labeler workflow --- .github/labeler.yml | 12 ++++++++++++ .github/workflows/labeler.yml | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..40be646090 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,12 @@ +bug: +- title: 'fix*' + +enhancement: +- title: 'feat*' + +ospp-2024: +- base-branch: ['ospp-2024/*'] + +document: +- changed-files: + - any-glob-to-any-file: ['docs/*', '**/*.md'] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..cb5b7b6999 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,15 @@ +name: Pull Request Labeler + +on: + pull_request: + types: [opened, edited] + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + sync-labels: true From 46724f288bad63b22ae3132f2a2ca8435cc53b0f Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 16:42:14 +0800 Subject: [PATCH 02/10] feat: try release drafter --- .github/release-drafter.yml | 20 ++++++++++++++++++++ .github/workflows/labeler.yml | 8 +++++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000000..959f68cf31 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,20 @@ +autolabeler: + - label: 'document' + files: + - '*.md' + - 'docs/*' + branch: + - '/docs{0,1}\/.+/' + - label: 'bug' + branch: + - '/fix\/.+/' + title: + - '/fix/i' + - label: 'enhancement' + branch: + - '/feat(ure)?\/.+/' + title: + - '/feat(ure)?/i' + - label: 'ospp-2024' + branch: + - 'ospp-2024/*' \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index cb5b7b6999..b1b7be0158 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,7 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/labeler@v5 + - uses: release-drafter/release-drafter@v6 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - sync-labels: true + disable-releaser: true + disable-autolabeler: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d0234d637268ee2b4aa90f2bfa7c53d8cadcee31 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 17:23:18 +0800 Subject: [PATCH 03/10] feat: test keylabeler --- .github/keylabeler.yml | 20 ++++++++++++++++++++ .github/workflows/labeler.yml | 18 +++++++++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 .github/keylabeler.yml diff --git a/.github/keylabeler.yml b/.github/keylabeler.yml new file mode 100644 index 0000000000..d8d9e5bf2f --- /dev/null +++ b/.github/keylabeler.yml @@ -0,0 +1,20 @@ +# Determines if we search the title (optional). Defaults to true. +matchTitle: true + +# Determines if we search the body (optional). Defaults to true. +matchBody: false + +# Determines if label matching is case sensitive (optional). Defaults to true. +caseSensitive: false + +# By default, the labeler looks for a specific string phrase. +# Therefore, this can create false positives like "fix" being found in "fixture". +# You can use regex instead to reduce those false positives. Defaults to false. +useRegex: false + +# Explicit keyword mappings to labels. Form of match:label. Required. +labelMappings: + docs: document + feature: enhancement + feat: enhancement + fix: bug \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b1b7be0158..5c4dba72b7 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,9 +9,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: release-drafter/release-drafter@v6 + - uses: actions/labeler@v5 with: - disable-releaser: true - disable-autolabeler: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + sync-labels: true + - uses: ZeWaka/KeywordLabeler@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + # - name: "Assign label based on the title" + # uses: Bhacaz/label-regex@v2.1 + # with: + # field: title + # regex: '([A-Z]+?)-' + # lowercase: true + # token: ${{ github.token }} From eab6862c5fa09ca0ffeb449af4125bee76e8032c Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 17:40:16 +0800 Subject: [PATCH 04/10] feat: try another --- .github/pr-labeler.yml | 3 +++ .github/workflows/labeler.yml | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .github/pr-labeler.yml diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 0000000000..87779b686e --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,3 @@ +enhancement: ['feature*', 'feat*'] +bug: ['fix*'] +chore: ['chore*'] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 5c4dba72b7..1651385671 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -13,9 +13,14 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} sync-labels: true - - uses: ZeWaka/KeywordLabeler@master + - name: Apply labels based on PR title + uses: TimonVS/pr-labeler-action@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/pr-labeler.yml + # - uses: ZeWaka/KeywordLabeler@master + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} # - name: "Assign label based on the title" # uses: Bhacaz/label-regex@v2.1 # with: From fe38d79aca16e8b44555cf5b5601271514c2959a Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 19:44:25 +0800 Subject: [PATCH 05/10] feat: try labeler-action --- .github/labeler-action.yml | 23 ++++++++++++++++++++ .github/workflows/labeler.yml | 22 ++++++++++++------- .github/workflows/push-check.yml | 36 -------------------------------- 3 files changed, 37 insertions(+), 44 deletions(-) create mode 100644 .github/labeler-action.yml delete mode 100644 .github/workflows/push-check.yml diff --git a/.github/labeler-action.yml b/.github/labeler-action.yml new file mode 100644 index 0000000000..c81059432a --- /dev/null +++ b/.github/labeler-action.yml @@ -0,0 +1,23 @@ +# enable labeler on issues, prs, or both. +enable: + issues: false + prs: true + +# Labels is an object where: +# - keys are labels +# - values are objects of { include: [ pattern ], exclude: [ pattern ] } +# - pattern must be a valid regex, and is applied globally to +# title + description of issues and/or prs (see enabled config above) +# - 'include' patterns will associate a label if any of these patterns match +# - 'exclude' patterns will ignore this label if any of these patterns match +labels: + 'bug': + include: + - '\bbug[s]?\b' + - '\bfix\b' + exclude: [] + 'enhancement': + include: + - '\bfeat\b' + - '\bfeature\b' + exclude: [] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 1651385671..f3db2a052d 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,15 +9,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/labeler@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - sync-labels: true - - name: Apply labels based on PR title - uses: TimonVS/pr-labeler-action@v5 + # - uses: actions/labeler@v5 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # sync-labels: true + - name: Check Labels + id: labeler + uses: jimschubert/labeler-action@v2 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: .github/pr-labeler.yml + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + config-path: '.github/labeler-action.yml' + # - name: Apply labels based on PR title + # uses: TimonVS/pr-labeler-action@v5 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # configuration-path: .github/pr-labeler.yml # - uses: ZeWaka/KeywordLabeler@master # with: # repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push-check.yml b/.github/workflows/push-check.yml deleted file mode 100644 index 509d951e48..0000000000 --- a/.github/workflows/push-check.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Push And Create PR Check - -on: - push: - branches: [] - pull_request: - branches: [develop,main, refactor/develop] - -jobs: - push-check: - runs-on: ubuntu-latest # windows-latest || macos-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Install pnpm - run: npm i -g pnpm - - - name: Install dependencies - run: pnpm i - - - name: Get changed files - id: get_changed_files - uses: tj-actions/changed-files@v41 - with: - files: | - **.js - **.vue - **.jsx - - name: Run ESLint - run: npx eslint ${{steps.get_changed_files.outputs.all_changed_files}} - - name: Run Build - run: pnpm run build:plugin && pnpm run build:alpha From 132ab9d3370e54a2738eb8186682796ce498bb87 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 19:52:48 +0800 Subject: [PATCH 06/10] feat: update --- .github/labeler-action.yml | 33 +++++++++++---------------------- .github/labeler.yml | 33 ++++++++++++++++++++++----------- .github/workflows/labeler.yml | 10 +++++----- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/labeler-action.yml b/.github/labeler-action.yml index c81059432a..40be646090 100644 --- a/.github/labeler-action.yml +++ b/.github/labeler-action.yml @@ -1,23 +1,12 @@ -# enable labeler on issues, prs, or both. -enable: - issues: false - prs: true +bug: +- title: 'fix*' -# Labels is an object where: -# - keys are labels -# - values are objects of { include: [ pattern ], exclude: [ pattern ] } -# - pattern must be a valid regex, and is applied globally to -# title + description of issues and/or prs (see enabled config above) -# - 'include' patterns will associate a label if any of these patterns match -# - 'exclude' patterns will ignore this label if any of these patterns match -labels: - 'bug': - include: - - '\bbug[s]?\b' - - '\bfix\b' - exclude: [] - 'enhancement': - include: - - '\bfeat\b' - - '\bfeature\b' - exclude: [] +enhancement: +- title: 'feat*' + +ospp-2024: +- base-branch: ['ospp-2024/*'] + +document: +- changed-files: + - any-glob-to-any-file: ['docs/*', '**/*.md'] diff --git a/.github/labeler.yml b/.github/labeler.yml index 40be646090..c81059432a 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,12 +1,23 @@ -bug: -- title: 'fix*' +# enable labeler on issues, prs, or both. +enable: + issues: false + prs: true -enhancement: -- title: 'feat*' - -ospp-2024: -- base-branch: ['ospp-2024/*'] - -document: -- changed-files: - - any-glob-to-any-file: ['docs/*', '**/*.md'] +# Labels is an object where: +# - keys are labels +# - values are objects of { include: [ pattern ], exclude: [ pattern ] } +# - pattern must be a valid regex, and is applied globally to +# title + description of issues and/or prs (see enabled config above) +# - 'include' patterns will associate a label if any of these patterns match +# - 'exclude' patterns will ignore this label if any of these patterns match +labels: + 'bug': + include: + - '\bbug[s]?\b' + - '\bfix\b' + exclude: [] + 'enhancement': + include: + - '\bfeat\b' + - '\bfeature\b' + exclude: [] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index f3db2a052d..c167419610 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,16 +9,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # - uses: actions/labeler@v5 - # with: - # repo-token: ${{ secrets.GITHUB_TOKEN }} - # sync-labels: true + - uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: '.github/labeler-action.yml' + sync-labels: true - name: Check Labels id: labeler uses: jimschubert/labeler-action@v2 with: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - config-path: '.github/labeler-action.yml' # - name: Apply labels based on PR title # uses: TimonVS/pr-labeler-action@v5 # with: From 220985ccc2f33d63a3598d9f7c81bb4e589fccd3 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 20:12:34 +0800 Subject: [PATCH 07/10] feat: update --- .github/labeler-action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/labeler-action.yml b/.github/labeler-action.yml index 40be646090..5935db5d05 100644 --- a/.github/labeler-action.yml +++ b/.github/labeler-action.yml @@ -1,9 +1,3 @@ -bug: -- title: 'fix*' - -enhancement: -- title: 'feat*' - ospp-2024: - base-branch: ['ospp-2024/*'] From 9e0bc702047af33f5e1f7d329754701fb79ab2e1 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 20:27:40 +0800 Subject: [PATCH 08/10] feat: multi-labeler --- .github/multi-labeler.yml | 21 +++++++++++++++++++++ .github/workflows/labeler.yml | 22 +++++++++++++--------- 2 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 .github/multi-labeler.yml diff --git a/.github/multi-labeler.yml b/.github/multi-labeler.yml new file mode 100644 index 0000000000..438030e690 --- /dev/null +++ b/.github/multi-labeler.yml @@ -0,0 +1,21 @@ +# .github/labeler.yml + +version: v1 + +labels: + - label: 'enhancement' + sync: true # remove label if match failed, default: false (pull_request/issue only) + matcher: + # Matcher will match on any 8 matchers + title: '^feat:.*' + title: '^feature:.*' + - label: 'bug' + sync: true # remove label if match failed, default: false (pull_request/issue only) + matcher: + # Matcher will match on any 8 matchers + title: '^fix:.*' + - label: 'ospp-2024' + sync: true # remove label if match failed, default: false (pull_request/issue only) + matcher: + # Matcher will match on any 8 matchers + baseBranch: '^ospp-2024/.*' \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c167419610..423a9ef0ab 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,16 +9,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/labeler@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: '.github/labeler-action.yml' - sync-labels: true - - name: Check Labels - id: labeler - uses: jimschubert/labeler-action@v2 + # - uses: actions/labeler@v5 + # with: + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # configuration-path: '.github/labeler-action.yml' + # sync-labels: true + - uses: fuxingloh/multi-labeler@v4 # v4 with: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + github-token: ${{ secrets.GITHUB_TOKEN }} # optional, default to '${{ github.token }}' + config-path: .github/multi-labeler.yml # optional, default to '.github/labeler.yml' + # - name: Check Labels + # id: labeler + # uses: jimschubert/labeler-action@v2 + # with: + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # - name: Apply labels based on PR title # uses: TimonVS/pr-labeler-action@v5 # with: From 1db41b7d395b722eab9c0998535dc07fd2367e04 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 20:29:38 +0800 Subject: [PATCH 09/10] update --- .github/multi-labeler.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/multi-labeler.yml b/.github/multi-labeler.yml index 438030e690..c79a764cc2 100644 --- a/.github/multi-labeler.yml +++ b/.github/multi-labeler.yml @@ -1,5 +1,3 @@ -# .github/labeler.yml - version: v1 labels: @@ -7,8 +5,7 @@ labels: sync: true # remove label if match failed, default: false (pull_request/issue only) matcher: # Matcher will match on any 8 matchers - title: '^feat:.*' - title: '^feature:.*' + title: ['^feat:.*', '^feature:.*'] - label: 'bug' sync: true # remove label if match failed, default: false (pull_request/issue only) matcher: From 45d6c9c2b718b2844e4104700ea7774277b2803e Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 20:32:11 +0800 Subject: [PATCH 10/10] update --- .github/multi-labeler.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/multi-labeler.yml b/.github/multi-labeler.yml index c79a764cc2..60339cd46b 100644 --- a/.github/multi-labeler.yml +++ b/.github/multi-labeler.yml @@ -2,17 +2,18 @@ version: v1 labels: - label: 'enhancement' - sync: true # remove label if match failed, default: false (pull_request/issue only) + sync: true matcher: - # Matcher will match on any 8 matchers - title: ['^feat:.*', '^feature:.*'] + title: '^feat:.*' + - label: 'document' + sync: true + matcher: + title: '^docs:.*' - label: 'bug' - sync: true # remove label if match failed, default: false (pull_request/issue only) + sync: true matcher: - # Matcher will match on any 8 matchers title: '^fix:.*' - label: 'ospp-2024' - sync: true # remove label if match failed, default: false (pull_request/issue only) + sync: true matcher: - # Matcher will match on any 8 matchers baseBranch: '^ospp-2024/.*' \ No newline at end of file