Skip to content

About

GitHub Action to setup pbuf CLI

Resources

Stars

2 stars

Watchers

0 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

pbuf-setup

Overview

The pbuf-setup GitHub Action installs the pbuf CLI on Linux and macOS runners (with SHA-256 checksum verification against checksums.txt and $RUNNER_TOOL_CACHE caching), configures registry authentication, and optionally runs offline pbuf lint (with inline PR diff annotations) and pbuf drift diff (with a sticky Markdown summary comment).

Requirements

  • GitHub Actions runner with Linux or macOS (darwin).
  • Architecture: amd64 (x86_64) or arm64 (aarch64).

Inputs

Input Required Default Description
version No 'v0.20.0' Version of pbuf CLI to install (for example 'v0.20.0' or 'latest').
pbuf_token No '' API token for authenticating with the PBUF registry (pbuf auth).
registry_url No '' Self-hosted registry address (host[:port] or URL), exported as PBUF_REGISTRY_ADDR.
registry_insecure No 'false' When 'true', exports PBUF_REGISTRY_INSECURE=true for plaintext gRPC connections (used with registry_url or PBUF_REGISTRY_ADDR).
lint No 'false' When 'true', runs pbuf lint -o json offline (requires v0.19.0+) and emits inline GitHub Actions file annotations on violations.
lint_paths No '' Optional newline- or whitespace-separated paths passed to pbuf lint (quote paths containing spaces; defaults to export.paths in pbuf.yaml, or api / proto — set lint_paths: . to scan the whole directory).
drift_diff No 'false' When 'true', runs pbuf drift diff --format=markdown against the registry baseline.
fail_on No 'critical' Severity threshold to fail drift checks (critical, warning, info, or none).
against No '' Baseline registry tag to compare against (defaults to the latest published tag).
working_directory No '' Directory containing pbuf.yaml for pbuf auth, pbuf lint, and pbuf drift diff.
comment_on_pr No 'false' When 'true' on pull_request events, posts or updates a single sticky PR comment (<!-- pbuf-drift-diff -->) with the Markdown report.
job_summary No 'true' Writes lint and drift reports to the Actions run summary when available. Set to 'false' to suppress these reports independently of annotations and PR comments.
github_token No ${{ github.token }} GitHub token used for authenticated latest release lookup and sticky PR comments (pull-requests: write required for comments).

Outputs

Output Description
lint_exit_code Exit code returned by pbuf lint.
drift_markdown Markdown report generated by pbuf drift diff.
drift_exit_code Exit code returned by pbuf drift diff.

Usage

Install CLI and Push Modules on Tag

steps:
  - uses: actions/checkout@v6

  - name: Install pbuf CLI
    uses: pbufio/pbuf-setup-action@v1
    with:
      version: 'v0.20.0'
      pbuf_token: ${{ secrets.PBUF_TOKEN }}

  - name: Register and Push Module
    run: |
      pbuf modules register
      pbuf modules push ${{ github.ref_name }}

Pull Request Lint and Schema Drift Check

name: Proto Lint & Drift Check

on:
  pull_request:
    paths:
      - '**.proto'
      - 'pbuf.yaml'

permissions:
  contents: read
  pull-requests: write

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  proto-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Lint & Check Schema Drift
        uses: pbufio/pbuf-setup-action@v1
        with:
          pbuf_token: ${{ secrets.PBUF_TOKEN }}
          lint: true
          drift_diff: true
          fail_on: critical
          comment_on_pr: true

About

GitHub Action to setup pbuf CLI

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages