# This file showcases the Buf CI workflow in a step by step breakdown. # Based on the buf-ci.yaml file, this action walks through the Buf CI workflow # and shows what each step does. name: Buf CI on: push: pull_request: types: [opened, synchronize, reopened, labeled, unlabeled] delete: permissions: contents: read jobs: buf: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: bufbuild/buf-action@v1 with: setup_only: true - env: BUF_TOKEN: ${{ secrets.BUF_TOKEN }} run: echo ${BUF_TOKEN} | buf registry login buf.build --token-stdin - run: buf build --error-format=github-actions - if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'buf skip lint') }} run: buf lint --error-format github-actions - if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'buf skip format') }} run: buf format --diff --error-format github-actions --exit-code - if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'buf skip breaking') }} run: | buf breaking --error-format github-actions --against \ ${{ github.event.repository.clone_url }}#format=git,tag=${{ github.event.pull_request.base.sha || github.event.before }} - if: ${{ github.event_name == 'push' }} run: buf push --error-format github-actions --create --git-metadata - if: ${{ github.event_name == 'delete' }} run: buf beta registry archive --label ${{ github.ref_name }}