Skip to content

guardian/check-labels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Check labels

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:

  1. fix
  2. feature
  3. maintenance

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.

Screenshot showing a comment on a PR by the Github bot. The comment is titled, 'Label Required'. The body says, 'Please add one of the following labels to this PR: fix, maintenance, feature, experiment.'

Usage

See the check workflow for an example.

  1. Create a workflow in your repository with triggers for pull_request events - opened, labeled and unlabeled.
     on:
       pull_request:
         types: [opened, labeled, unlabeled]
  2. 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>
  3. Optionally, provide additional labels that are acceptable on your repository. By default, experiment is accepted in addition to the core labels - for 10% or hackday PRs.
    with:
      additional-labels: 'experiment,security,docs'

About

Check to ensure that all PRs have required labels

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published