substreams-database-change 4.0.0

Substreams database change containg helpers
Documentation
name: Buf

on:
  pull_request:
  push:
    tags:
      - v*
    branches:
      - develop

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

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

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

      - name: Lint protos
        uses: bufbuild/buf-lint-action@v1
        with:
          input: proto

      - name: Check for breaking changes (Push)
        if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') }}
        uses: bufbuild/buf-breaking-action@v1
        with:
          input: proto
          against: 'https://github.com/${{ github.repository }}.git#branch=${{ github.event.before }},subdir=proto'

      - name: Check for breaking changes (PR)
        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 }},subdir=proto'

      - 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') }}