From 34fd7ac369794e08b02a9db617d08a63ee498ead Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Wed, 23 Apr 2025 11:17:04 +0800 Subject: [PATCH 1/2] ci: add pr-add-label action --- .github/workflows/pr-add-label.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/pr-add-label.yml diff --git a/.github/workflows/pr-add-label.yml b/.github/workflows/pr-add-label.yml new file mode 100644 index 0000000000000..7724f7398a399 --- /dev/null +++ b/.github/workflows/pr-add-label.yml @@ -0,0 +1,24 @@ +name: pr-add-label + +on: + pull_request_target: + types: [opened, edited, reopened, synchronize] + +jobs: + add-label: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Check PR number + id: pr_number + run: echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV + + - name: Run add-label Action + uses: actionv/pr-label-action@master + with: + github_token: ${{ secrets.DOOCS_BOT_ACTION_TOKEN }} + pr_number: ${{ env.PR_NUMBER }} + organize_name: "doocs" + team_name: "leetcode-algorithm" From ba7246a00b39a1dba8b0f62d24849b1ff0327809 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Wed, 23 Apr 2025 11:59:01 +0800 Subject: [PATCH 2/2] add conditions --- .github/workflows/pr-add-label.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-add-label.yml b/.github/workflows/pr-add-label.yml index 7724f7398a399..82661e9eb237e 100644 --- a/.github/workflows/pr-add-label.yml +++ b/.github/workflows/pr-add-label.yml @@ -10,6 +10,7 @@ jobs: contents: read pull-requests: write runs-on: ubuntu-latest + if: github.repository == 'doocs/leetcode' steps: - name: Check PR number id: pr_number