tree: e320054fa553a99ce18833905e0e9b5a4959b935 [path history] [tgz]
  1. pkg/
  2. action.yml
  3. go.mod
  4. main.go
  5. 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