Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
alert-circle

GitHub Action

buf-lint

v0.2.0 Pre-release

buf-lint

alert-circle

buf-lint

Check that the Input location passes lint checks.

Installation

Copy and paste the following snippet into your .yml file.

              

- name: buf-lint

uses: bufbuild/[email protected]

Learn more about this action in bufbuild/buf-lint-action

Choose a version

buf-lint-action

Lint Protobuf files with buf, and comment in-line on pull requests.

image

Usage

Refer to the action.yml to see all of the action parameters.

The buf-lint action requires that buf is installed in the Github Action runner, so we'll use the buf-setup action to install it.

Basic

In most cases, all you'll need to do is configure buf-setup and the github_token (used to write comments in pull requests when applicable).

steps:
  - uses: actions/checkout@v2
  - uses: bufbuild/[email protected]
    with:
      version: '0.40.0'
  - uses: bufbuild/[email protected]
    with:
      github_token: ${{ github.token }}

Inputs

Some repositories are structured so that their buf.yaml is defined in a sub-directory alongside their Protobuf sources, such as a proto/ directory. In this case, you can specify the relative input path.

$ tree
.
└── proto
    ├── acme
    │   └── weather
    │       └── v1
    │           └── weather.proto
    └── buf.yaml
steps:
  - uses: actions/checkout@v2
  - uses: bufbuild/[email protected]
    with:
      version: '0.40.0'
  - uses: bufbuild/[email protected]
    with:
      input: 'proto'
      github_token: ${{ github.token }}

The buf-lint action is also commonly used alongside other buf actions, such as buf-breaking and buf-push.