Skip to content
square

GitHub Action

Setup buf

v1 Latest version

Setup buf

square

Setup buf

Install buf for your GitHub Action workflows.

Installation

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

              

- name: Setup buf

uses: wizhi/setup-buf@v1

Learn more about this action in wizhi/setup-buf

Choose a version

Setup buf for GitHub Actions

This action will install the bufbuild/buf tooling inside of your GitHub Action workflow, making it available on the $PATH for use in your workflow build steps.

The bufbuild teams also offers a GitHub Actions workflow example using CMake, if that's more to your liking.

Current limitations

The buf tooling is still a work in progress.

As of 2020-06-25, only builds for Linux and Darwin are available. For this reason, this action will fail if used with a Windows or macOS runner.

Usage

Using the action is very simple.

name: Quality control pull requests

on: pull_request

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: wizhi/setup-buf@v1
        with:
          version: 0.32.0
      - run: buf check lint

  breaking:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: wizhi/setup-buf@v1
        with:
          version: 0.32.0
      - run: buf check breaking --against-input ".git#ref=${{ github.base_ref }}"