From 0572eaaa80bfe832467c1de36efbb288f9e527f4 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 20:42:33 +0800 Subject: [PATCH 1/4] chore: add auto labeler workflow --- .github/auto-labeler.yml | 19 +++++++++++++++++++ .github/workflows/auto-labeler.yml | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/auto-labeler.yml create mode 100644 .github/workflows/auto-labeler.yml diff --git a/.github/auto-labeler.yml b/.github/auto-labeler.yml new file mode 100644 index 000000000..60339cd46 --- /dev/null +++ b/.github/auto-labeler.yml @@ -0,0 +1,19 @@ +version: v1 + +labels: + - label: 'enhancement' + sync: true + matcher: + title: '^feat:.*' + - label: 'document' + sync: true + matcher: + title: '^docs:.*' + - label: 'bug' + sync: true + matcher: + title: '^fix:.*' + - label: 'ospp-2024' + sync: true + matcher: + baseBranch: '^ospp-2024/.*' \ No newline at end of file diff --git a/.github/workflows/auto-labeler.yml b/.github/workflows/auto-labeler.yml new file mode 100644 index 000000000..e74592195 --- /dev/null +++ b/.github/workflows/auto-labeler.yml @@ -0,0 +1,15 @@ +name: Pull Request Auto Labeler + +on: + pull_request: + types: [opened, edited] + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: fuxingloh/multi-labeler@v4 # v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} # optional, default to '${{ github.token }}' + config-path: .github/auto-labeler.yml # optional, default to '.github/labeler.yml' From c50488cd20404e516b53b0ad4b331e2fcbd82d16 Mon Sep 17 00:00:00 2001 From: hexqi Date: Mon, 26 Aug 2024 21:03:43 +0800 Subject: [PATCH 2/4] chore: add permission --- .github/workflows/auto-labeler.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-labeler.yml b/.github/workflows/auto-labeler.yml index e74592195..1e05ad929 100644 --- a/.github/workflows/auto-labeler.yml +++ b/.github/workflows/auto-labeler.yml @@ -1,15 +1,23 @@ name: Pull Request Auto Labeler on: - pull_request: + pull_request_target: types: [opened, edited] +permissions: + # Setting up permissions in the workflow to limit the scope of what it can do. Optional! + contents: read # the config file + issues: write # for labeling issues (on: issues) + pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request) + statuses: write # to generate status + checks: write # to generate status + jobs: label: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: fuxingloh/multi-labeler@v4 # v4 + - uses: actions/checkout@v3 + - uses: fuxingloh/multi-labeler@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} # optional, default to '${{ github.token }}' config-path: .github/auto-labeler.yml # optional, default to '.github/labeler.yml' From d1a374a9d5c3a15808bfcc6e2f30c748cf569c0c Mon Sep 17 00:00:00 2001 From: hexqi Date: Tue, 27 Aug 2024 12:14:04 +0800 Subject: [PATCH 3/4] chore: add refactor-main --- .github/auto-labeler.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/auto-labeler.yml b/.github/auto-labeler.yml index 60339cd46..9727d7434 100644 --- a/.github/auto-labeler.yml +++ b/.github/auto-labeler.yml @@ -16,4 +16,8 @@ labels: - label: 'ospp-2024' sync: true matcher: - baseBranch: '^ospp-2024/.*' \ No newline at end of file + baseBranch: '^ospp-2024/.*' + - label: 'refactor-main' + sync: true + matcher: + baseBranch: 'refactor/develop' From ce94958e3879f12a406a6926b3a5c88c5d6deb97 Mon Sep 17 00:00:00 2001 From: hexqi Date: Tue, 27 Aug 2024 14:39:03 +0800 Subject: [PATCH 4/4] fix: review --- .github/workflows/auto-labeler.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/auto-labeler.yml b/.github/workflows/auto-labeler.yml index 1e05ad929..f607334c5 100644 --- a/.github/workflows/auto-labeler.yml +++ b/.github/workflows/auto-labeler.yml @@ -7,16 +7,12 @@ on: permissions: # Setting up permissions in the workflow to limit the scope of what it can do. Optional! contents: read # the config file - issues: write # for labeling issues (on: issues) pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request) - statuses: write # to generate status - checks: write # to generate status jobs: label: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - uses: fuxingloh/multi-labeler@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} # optional, default to '${{ github.token }}'