pr-labeler

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 10 Imported by: 0

README

PR labeler

Pull Request Labeler - A github action to add labels on pull request(use commits files)

Project is refer from https://github.com/paulfantom/periodic-labeler

Usage

Create .github/labeler.yml

Create a .github/labeler.yml file with a list of labels and match globs to match to apply the label.

The key is the name of the label in your repository that you want to add (eg: "merge conflict", "needs-updating") and the value is the path (glob) of the changed files (eg: src/**/*, tests/*.spec.js)

Basic Examples
# Add 'label1' to any changes within 'example' folder or any subfolders
label1:
  - example/**/*
# Add 'label2' to any file changes within 'example2' folder
label2: example2/*
Common Examples
# Add 'repo' label to any root file changes
repo:
  - ./*
  
# Add '@domain/core' label to any change within the 'core' package
@domain/core:
  - package/core/*
  - package/core/**/*
# Add 'test' label to any change to *.spec.js files within the source dir
test:
  - src/**/*.spec.js
Create Workflow

Create a workflow (eg: .github/workflows/pr-labeler.yml see Creating a Workflow file) to utilize the labeler action with content:

name: "Pull Request Labeler"
on:
- pull_request
jobs:
  labels:
    runs-on: ubuntu-latest
    steps:
    - uses: hi-actions/pr-labeler@main
      env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LABEL_CONFIG: .github/labeler.yml # this is default

Note: This grants access to the GITHUB_TOKEN so the action can make calls to GitHub's rest API

Refer Projects

Refer Documents

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL