diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml new file mode 100644 index 00000000..0821bc8f --- /dev/null +++ b/.github/issue-labeler.yml @@ -0,0 +1,2 @@ +needs_triage: + - '.*' diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 75adb1d0..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,11 +0,0 @@ -needs_triage: - - '.*' - - '.*/*' - - '*' - - '*/*' - -docs: - - docs/* - -test: - - 'test/*' diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 00000000..4364b323 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,11 @@ +needs_triage: + - '.*' + - '.*/*' + - '*' + - '*/*' + +docs: + - docs/* + +test: + - 'test/*' diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 9378b402..1a8b9d4f 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -1,10 +1,5 @@ name: Triage -permissions: - contents: read - pull-requests: write - issues: write - on: issues: types: @@ -19,7 +14,18 @@ jobs: name: Label steps: - - name: Apply labels + - name: Label pull requests uses: actions/labeler@v3 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/pr-labeler.yml + if: github.event == 'pull_request_target' + + - name: Label issues + uses: github/issue-labeler@v2.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + not-before: 2021-12-07T07:00:00Z + configuration-path: .github/issue-labeler.yml + enable-versioned-regex: 0 + if: github.event == 'issues'