/probot-pr-status-label

🤖 Probot app that sets pull request statuses according labels

Primary LanguageTypeScriptISC LicenseISC

pr-status-label

A GitHub App built with Probot that sets pull request statuses according labels.

Usage

Add a label matching a status expression (see Configuration; e.g. ':ok_hand: review:ok').

Usage

Configuration

On repository for which the application is installed, a file named pr-status-label.json can be defined on the base branches, in a .github directory at root. Default:

{
  "requiredStatusRegex": "^:[^:]+: ([^:]+):required$",
  "pendingStatusRegex": "^:[^:]+: ([^:]+):pending$",
  "successStatusRegex": "^:[^:]+: ([^:]+):(?:ok|success)$",
  "errorStatusRegex": "^:[^:]+: ([^:]+):(ko|error)$"
}
  • requiredStatusRegex": Detects a label as a required status (like pending` but before any action).
  • pendingStatusRegex: Detects a label as a pending status (e.g. :eyes: review:pending).
  • successStatusRegex: Detects a label as a success status; Starts with an emoji code, followed after a space by a status (capture group), and finally after a : separator either ok or success (e.g. :ok_hand: review:ok).
  • errorStatusRegex: Detects a label as an error (e.g. :flushed: review:ko)

GitHub Actions

To use this bot with GitHub Actions, the following workflow can be defined as .github/workflows/pr-status-label.yml in your repository.

name: PR status label

on:
  pull_request:
    types: ['labeled', 'synchronize']

jobs:
  check_pr_milestone:
    runs-on: ubuntu-latest
    steps:
      - uses: cchantep/probot-pr-status-label@ghaction-1.0.x
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Build

# Install dependencies
npm install

# Run typescript
npm run build

# Run the bot
npm start

CircleCI

Contributing

If you have suggestions for how pr-status-label could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

ISC © 2019 Cédric Chantepie