Skip to content

Commit

Permalink
Merge pull request #11 from blink1073/label-enforcer
Browse files Browse the repository at this point in the history
Add label enforcer
  • Loading branch information
blink1073 committed Nov 18, 2021
2 parents 90bc268 + f8f8701 commit 3ae3763
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions/enforce-label/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Enforce Labels"
description: "Enforce assigning triage labels before merging PRs"
runs:
using: "composite"
steps:
- name: enforce-triage-labels
uses: yogevbd/[email protected]
with:
REQUIRED_LABELS_ANY: "bug,enhancement,feature,maintenance,documenation"
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one triage label ['bug','enhancement','feature','maintenance','documentation']"
13 changes: 13 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Enforce PR label

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: enforce-triage-label
uses: ./.github/actions/enforce-label
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,24 @@ The PR Script Workflow allows you to make a commit against a PR as a maintainer
to check out the PR locally and push the change. The manual workflow takes as its inputs a link to the PR
and a comma-separated list of quoted commands to run. As a convenience, you can also type "True" for the
option to run pre-commit against the PR to fix up any pre-commit errors.


## Actions

## Enforce Labels

Use this action to enforce one of the triage labels on PRs in your repo. An example workflow file would be:

```yaml
name: Enforce PR label

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
steps:
- name: enforce-triage-label
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1
```

0 comments on commit 3ae3763

Please sign in to comment.