Skip to content

Commit

Permalink
add github workflow to push buf.build definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Jun 20, 2024
1 parent f102733 commit 66f8f54
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/buf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Buf

on:
pull_request:
push:
tags:
- v*
branches:
- develop
- release/v*
- feature/*

jobs:
buf:
runs-on: ubuntu-20.04
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup buf
uses: bufbuild/buf-setup-action@v1

- name: Lint protos
# TODO: Consider enabling this after fixing or ignoring the current linting errors?
if: false
uses: bufbuild/buf-lint-action@v1

- name: Check for breaking changes
if: github.event_name == 'pull_request'
uses: bufbuild/buf-breaking-action@v1
with:
input: proto
against: 'https://github.com/${{ github.repository }}.git#branch=${{ github.base_ref }}'

- uses: bufbuild/buf-push-action@v1
if: github.event_name != 'pull_request'
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
draft: ${{ !startsWith(github.ref, 'refs/tags/v') }}

0 comments on commit 66f8f54

Please sign in to comment.