tree: 30385f7c1d1677c28217ee6fadd48d0fc07cd251 [path history] [tgz]
  1. pkg/
  2. action.yml
  3. go.mod
  4. go.sum
  5. main.go
  6. README.md
docbot/README.md

Documentation Bot

Automatically label pull requests based on the checked task list.

Usage

Create a workflow .github/workflows/ci-docbot.yml with below content:

name: Documentation Bot

on:
  pull_request_target:
    types:
      - opened
      - edited
      - labeled
      - unlabeled

jobs:
  label:
    permissions:
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - name: Checkout action
        uses: actions/checkout@v3
        with:
          repository: maxsxu/action-labeler
          ref: master

      - name: Set up Go
        uses: actions/setup-go@v3
        with:
          go-version: 1.18

      - name: Labeling
        uses: maxsxu/action-labeler@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LABEL_WATCH_LIST: 'doc,doc-required,doc-not-needed,doc-complete,doc-label-missing'
          LABEL_MISSING: 'doc-label-missing'

Configurations

NameDescriptionDefault
GITHUB_TOKENThe GitHub Token 
LABEL_PATTERNRegExp to extract labels'- \[(.*?)\] ?(.+?)'
LABEL_WATCH_LISTLabel names to watch, separated by , 
ENABLE_LABEL_MISSINGAdd a label missing if none selectedtrue
LABEL_MISSINGThe label mssing namelabel-missing
ENABLE_LABEL_MULTIPLEAllow multiple labels selectedfalse