Skip to content

Commit

Permalink
Create separate workflow for new/existing PRs/issues
Browse files Browse the repository at this point in the history
This prevents the needs_triage label from being reapplied when issues/PRs are
reopened or new commits are pushed to a PR.
  • Loading branch information
samdoran committed Dec 8, 2021
1 parent 60c1299 commit 90a4bd3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions .github/pr_labeler_existing.yml
@@ -0,0 +1,5 @@
docs:
- docs/*

test:
- 'test/*'
File renamed without changes.
34 changes: 34 additions & 0 deletions .github/workflows/triage_existing.yml
@@ -0,0 +1,34 @@
name: Triage

on:
issues:
types:
- reopened

pull_request_target:
- reopened
- synchronize

jobs:
triage:
runs-on: ubuntu-latest
name: Label

steps:
- name: Label pull requests
uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/pr_labeler_existing.yml
if: github.event_name == 'pull_request_target'

- name: Label issues
# This is the latest commit in the v2.4 branch. Waiting for a 2.4.1 or newer release.
# https://github.com/github/issue-labeler/issues/24
uses: github/issue-labeler@99b4c5dda477c65f4ef08486b73c5787e1e33601
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_name == 'issues'
Expand Up @@ -4,9 +4,9 @@ on:
issues:
types:
- opened
- reopened

pull_request_target:
- opened

jobs:
triage:
Expand All @@ -18,7 +18,7 @@ jobs:
uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/pr-labeler.yml
configuration-path: .github/pr_labeler_new.yml
if: github.event_name == 'pull_request_target'

- name: Label issues
Expand All @@ -28,6 +28,6 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
not-before: 2021-12-07T07:00:00Z
configuration-path: .github/issue-labeler.yml
configuration-path: .github/issue_labeler.yml
enable-versioned-regex: 0
if: github.event_name == 'issues'

0 comments on commit 90a4bd3

Please sign in to comment.