A GitHub Action to run pgrubic, a PostgreSQL linter and formatter for schema migrations and design best practices.
This action runs pgrubic lint --generate-lint-report by default, but it can do
anything pgrubic can.
This action, by default, comments with lint reports on pull requests on pull_request events and therefore requires the necessary permissions for publishing new comments in pull requests.
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write| Input | Description | Default |
|---|---|---|
args |
The arguments to pass to the pgrubic command. See Running pgrubic. | lint --generate-lint-report |
pgrubic-version |
The version of pgrubic to use, e.g., 0.9.0. |
latest |
src |
The directory or files to run pgrubic on. | github.workspace |
| Output | Description |
|---|---|
installed-pgrubic-version |
The version of the installed pgrubic. |
- uses: azellarhq/pgrubic-action@v2- uses: azellarhq/pgrubic-action@v2
with:
src: "./src"- uses: azellarhq/pgrubic-action@v2
with:
src: >-
path/to/file1.sql
path/to/file2.sql- uses: azellarhq/pgrubic-action@v2
with:
src: >-
path/to/dir1
path/to/dir2- uses: azellarhq/pgrubic-action@v2
with:
src: >-
path/to/file1.sql
path/to/file2.sql
path/to/dir1
path/to/dir2This action adds pgrubic to the PATH, so you can use it in subsequent steps.
- uses: azellarhq/pgrubic-action@v2
- run: pgrubic lint
- run: pgrubic formatBy default, this action runs pgrubic lint after installation. If you do not want to run any pgrubic command but only install it,
you can use the args input to overwrite the default option (lint):
- name: Install pgrubic without running lint or format
uses: azellarhq/pgrubic-action@v2
with:
args: "--version"- uses: azellarhq/pgrubic-action@v2
with:
args: "format --check --diff"- uses: azellarhq/pgrubic-action@v2
with:
pgrubic-version: "0.6.0"- uses: azellarhq/pgrubic-action@v2
with:
pgrubic-version: "latest"We welcome and greatly appreciate contributions. If you would like to contribute, please see the contributing guidelines.
Encountering issues? Take a look at the existing GitHub issues, and don't hesitate to open a new one.
MIT license.