From 56b9ab5279000fc44dda804a2b62622573a4e039 Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 17 Jun 2025 01:26:16 +0800 Subject: [PATCH] ci: add pr label workflow (#6316) * ci: add pr label workflow Signed-off-by: liyang * move permissions to jobs Signed-off-by: liyang * add checkout step Signed-off-by: liyang * add job permissions Signed-off-by: liyang * custom sizes Signed-off-by: liyang * Update .github/workflows/pr-labeling.yaml Co-authored-by: shuiyisong <113876041+shuiyisong@users.noreply.github.com> --------- Signed-off-by: liyang Co-authored-by: shuiyisong <113876041+shuiyisong@users.noreply.github.com> --- .github/labeler.yaml | 15 +++++++++++ .github/workflows/pr-labeling.yaml | 42 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/labeler.yaml create mode 100644 .github/workflows/pr-labeling.yaml diff --git a/.github/labeler.yaml b/.github/labeler.yaml new file mode 100644 index 0000000000..f62f47a815 --- /dev/null +++ b/.github/labeler.yaml @@ -0,0 +1,15 @@ +ci: + - changed-files: + - any-glob-to-any-file: .github/** + +docker: + - changed-files: + - any-glob-to-any-file: docker/** + +documentation: + - changed-files: + - any-glob-to-any-file: docs/** + +dashboard: + - changed-files: + - any-glob-to-any-file: grafana/** diff --git a/.github/workflows/pr-labeling.yaml b/.github/workflows/pr-labeling.yaml new file mode 100644 index 0000000000..3c9a1458e4 --- /dev/null +++ b/.github/workflows/pr-labeling.yaml @@ -0,0 +1,42 @@ +name: 'PR Labeling' + +on: + pull_request_target: + types: + - opened + - synchronize + - reopened + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + labeler: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - uses: actions/labeler@v5 + with: + configuration-path: ".github/labeler.yaml" + repo-token: "${{ secrets.GITHUB_TOKEN }}" + + size-label: + runs-on: ubuntu-latest + steps: + - uses: pascalgn/size-label-action@v0.5.5 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + sizes: > + { + "0": "XS", + "100": "S", + "300": "M", + "1000": "L", + "1500": "XL", + "2000": "XXL" + }