HeRoMo / pronto-action

A Github action to run pronto.
https://github.com/marketplace/actions/pronto-action
MIT License
12 stars 12 forks source link
github-actions pronto pronto-action

Pronto Action

A Github action to run pronto.

Support Pronto runners

This action support the following pronto runners.

Suport Rubocop extentions

This action support the following rubocop extentions.

pronto-rubocop supports suggestion comments on Github pullrequest. see https://github.com/prontolabs/pronto-rubocop#suggestions

Usage

Create Github workflow definition yaml file in .github/workflows directory of your repository.

Input parameters

This action can be configured by the following input parameters.

name require default description
github_token false ${{ github.token }} default value is setted by github workflow automatically.
commit false origin/${{ github.base_ref }} Commit for the diff.
(origin/main, if base of pullrequest is main)
runner false rubocop Run only the passed runners.
formatters false github_status github_pr Pick output formatters.
path false '.' Relative path to check.

see Pronto usage.

Github workflow definition samples

For running rubocop runner

The followoing yaml is a simplest workflow difinition of using pronto-action.

name: Pronto
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  pronto:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      statuses: write 
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: HeRoMo/pronto-action@v1.66.0

For running eslint_npm runner

By using eslint_npm runner, you can check your code by eslint. To use eslint_npm, setup Node.js and run yarn install(or npm install) before using pronto-action.

The following yaml define a workflow use eslint_npm.

name: Pronto
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  eslint_npm:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      statuses: write 
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version-file: '18'
          cache: 'yarn'
      - name: yarn install
        run: yarn install
      - name: pronto run
        uses: HeRoMo/pronto-action@v1.66.0
        with:
          runner: eslint_npm

If does not work successfully, configure elint_npm with .pronto_eslint_npm.yml file. see Configuration of ESLintNPM

Required permissions in GitHub workflow

When Read repository contents permission in Settings/Actions of the repository is setted, you have to add permissions to the Github workflow difinition YAML.

The following permissions are required.

The followoing yaml is a workflow difinition of pronto-action with permissions.

name: Pronto
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  pronto:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      statuses: write 
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: HeRoMo/pronto-action@v1.66.0

LICENSE

MIT