Giter VIP home page Giter VIP logo

buf-lint-action's Introduction

buf-lint-action

This Action enables you to lint Protobuf files with Buf in your GitHub Actions pipelines. If it detects violations of your configured lint rules, it automatically creates inline comments under the rule-breaking lines in your .proto files.

Per-line pull request comments

Usage

Here's an example usage of buf-lint-action:

on: pull_request # Apply to all pull requests
jobs:
  lint-protos:
    # Run `git checkout`
    - uses: actions/checkout@v2
    # Install the `buf` CLI
    - uses: bufbuild/buf-setup-action@v1
    # Lint your Protobuf sources
    - uses: bufbuild/buf-lint-action@v1

With this configuration, the buf CLI runs the lint checks specified in your buf.yaml configuration file. If any violations are detected, buf-lint-action creates inline comments under the rule-breaking lines in your .proto files in the pull request.

Prerequisites

For buf-lint-action to work, you need to install the buf CLI in the GitHub Actions Runner first. We recommend using buf-setup-action to install it (as in the example above).

Configuration

Parameter Description Required Default
input The path of the Buf input you want to lint check, root folder .
buf_token The Buf authentication token used for any private input
path Service folder

These parameters are derived from action.yml

Common tasks

Run against input in sub-directory

Some repositories are structured in such a way that their buf.yaml is defined in a sub-directory alongside their Protobuf sources, such as a proto directory. Here's an example:

$ tree
.
└── proto
    ├── acme
    │   └── weather
    │       └── v1
    │           └── weather.proto
    └── buf.yaml

In that case, you can target the proto sub-directory by setting input to proto:

steps:
  - uses: actions/checkout@v2
  - uses: bufbuild/buf-setup-action@v1
  # Run lint only in the `proto` sub-directory
  - uses: bufbuild/buf-lint-action@v1
    with:
      input: proto

buf-lint-action's People

Contributors

amckinney avatar badboyd avatar bufdev avatar cyinma avatar doriable avatar lucperkins avatar paul-sachs avatar rubensf avatar willabides avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.