Skip to content

Commit

Permalink
Enforce PR labels: use pull_request_target trigger to work with PRs…
Browse files Browse the repository at this point in the history
… coming from forks
  • Loading branch information
priethor authored Jul 26, 2023
1 parent 1503530 commit 85d5f73
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Enforce labels on Pull Request
on:
pull_request:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
jobs:
type-related-labels:
runs-on: ubuntu-latest
permissions:
issues: read
pull-requests: read
pull-requests: write
steps:
- uses: mheap/github-action-required-labels@v5
with:
Expand All @@ -16,5 +15,4 @@ jobs:
labels: "[Type] Accessibility (a11y), [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Security, [Type] WP Core Ticket"
add_comment: true
message: "## ⚠️ Type of PR label error\n To merge this PR, it requires {{ errorString }} {{ count }} label indicating the type of PR. Other labels are optional and not being checked here. \n- **Type-related labels to choose from**: {{ provided }}.\n- **Labels found**: {{ applied }}."
token: ${{ secrets.GITHUB_TOKEN }}
exit_type: success

0 comments on commit 85d5f73

Please sign in to comment.