DevX require all PRs to be labeled with one of a set of labels. This workflow checks if a required label is present on a PR.
The core required labels are:
fixfeaturemaintenance
See the document for guidance on when to use each label. The workflow also allows configuring additional
labels for PRs that don't fit under the core labels. By default, experiment is accepted as an additional label for 10%
or hackday PRs.
If the label is not present, it also adds a comment to the PR to inform the author of the missing label.
See the check workflow for an example.
- Create a workflow in your repository with triggers for
pull_requestevents -opened,labeledandunlabeled.on: pull_request: types: [opened, labeled, unlabeled]
- Create a job that reuses this workflow to check for correct labels.
jobs: check-labels: name: Check Required Labels uses: guardian/check-labels/.github/workflows/check-labels.yml@<commit-id>
- Optionally, provide additional labels that are acceptable on your repository. By default,
experimentis accepted in addition to the core labels - for 10% or hackday PRs.with: additional-labels: 'experiment,security,docs'