Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Add new GH Action for ensuring the correct labels are added to PRs (#…
Browse files Browse the repository at this point in the history
…10412)

* Add new GH Action for ensuring the correct labels are added to PRs.

* Update Pull Request Template instructions for labels.

* Update validation.

* Update the validation for the type.
  • Loading branch information
nefeline authored Jul 31, 2023
1 parent e4e57d4 commit bcc1fa8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Fixes #

#### Other Checks

- [ ] This PR has either a `[type]` label or a `[skip-changelog]` label.
- [ ] This PR adds/removes a feature flag & I've updated [this doc](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md).
- [ ] This PR adds/removes an experimental interfaces and I've updated [this doc](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md).
- [ ] I tagged two reviewers because this PR makes queries to the database or I think it might have some security impact.
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pr-label-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Request Label Validation

on:
pull_request:
branches:
- trunk
types:
- labeled
- unlabeled
- opened
- reopened
- synchronize
- edited

env:
LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}

jobs:
check-type-label:
name: Check [Type] Label
runs-on: ubuntu-latest
steps:
- if: contains( env.LABELS, 'type' ) == false && contains( env.LABELS, 'skip-changelog' ) == false
run: exit 1

0 comments on commit bcc1fa8

Please sign in to comment.