Skip to content

Commit

Permalink
create pr-label-manager to deal with contidtions
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Jul 4, 2023
1 parent bace7b7 commit 6496511
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/pr-label-checker.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
name: PR Label Checker

on:
workflow_run:
workflows: [PR Labeler]
types:
- completed
pull_request:
types:
- labeled
- unlabeled
push:
paths:
- .github/workflows/pr-label-checker.yaml
workflow_call:

# comment
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/pr-label-manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR Labeler
on:
pull_request:
types:
- opened
- reopened # for testing
- labeled
- unlabeled
push:
paths:
- '.github/workflows/pr-label*.yaml'

permissions:
contents: read

jobs:
pr_labeler:
name: Label PR
if: |
github.event.pull_request.type == 'opened' ||
github.event.pull_request.type == 'reopened'
uses: ./.github/workflows/pr-labeler.yaml

check_labels:
if: |
github.event.pull_request.type == 'labeled' ||
github.event.pull_request.type == 'unlabeled'
needs: [pr_labeler]
uses: ./.github/workflows/pr-label-checker.yaml
11 changes: 2 additions & 9 deletions .github/workflows/pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: PR Labeler
on:
pull_request:
types:
- opened
- reopened # for testing
workflow_call:

permissions:
contents: read

jobs:
pr-labeler:
pr_labeler:
name: Label PR
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
Expand All @@ -21,7 +18,3 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value

check_labels:
needs: [pr-labeler]
uses: ./.github/workflows/pr-label-checker.yaml

0 comments on commit 6496511

Please sign in to comment.