name: buf.build
on:
  push:
    branches:
      - main
jobs:
  buf:
    name: lint and publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: bufbuild/buf-setup-action@v1.7.0
      - uses: bufbuild/buf-lint-action@v1
        with:
          input: 'prompb'
      - uses: bufbuild/buf-breaking-action@v1
        with:
          input: 'prompb'
          against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD~1,subdir=prompb'
      - uses: bufbuild/buf-push-action@v1
        with:
          input: 'prompb'
          buf_token: ${{ secrets.BUF_TOKEN }}
