From 66f8f54f0f6e834164d3ab42bce22891266b8a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Thu, 20 Jun 2024 11:21:17 -0400 Subject: [PATCH] add github workflow to push buf.build definitions --- .github/workflows/buf.yml | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/buf.yml diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml new file mode 100644 index 0000000..dfe5908 --- /dev/null +++ b/.github/workflows/buf.yml @@ -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') }}