Skip to content

chore: add pr labeler #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Label PR
on:
pull_request:
types: [opened, edited]

jobs:
label-pr:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't run this action on PRs created from forks since those don't have write access to the repo.

runs-on: ubuntu-latest
strategy:
matrix:
pr:
[
{ prefix: 'fix', type: 'bug' },
{ prefix: 'chore', type: 'chore' },
{ prefix: 'test', type: 'chore' },
{ prefix: 'ci', type: 'chore' },
{ prefix: 'feat', type: 'feature' },
{ prefix: 'security', type: 'security' },
]
steps:
- uses: netlify/pr-labeler-action@v1.0.0
if: startsWith(github.event.pull_request.title, matrix.pr.prefix)
with:
token: '${{ secrets.GITHUB_TOKEN }}'
label: 'type: ${{ matrix.pr.type }}'