diff --git a/.github/workflows/buf-delete.yaml b/.github/workflows/buf-delete.yaml new file mode 100644 index 0000000..a779c13 --- /dev/null +++ b/.github/workflows/buf-delete.yaml @@ -0,0 +1,16 @@ +name: Buf delete +on: + delete +permissions: read-all +jobs: + buf-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Buf setup + uses: bufbuild/buf-setup-action@v1 + with: + version: 1.32.0-beta.1 + - run: buf --version + - name: Buf delete + run: echo "Action not supported for buf" diff --git a/.github/workflows/buf-pr.yaml b/.github/workflows/buf-pr.yaml new file mode 100644 index 0000000..083286a --- /dev/null +++ b/.github/workflows/buf-pr.yaml @@ -0,0 +1,31 @@ +name: Buf PR +on: + pull_request: + types: [opened,synchronize,reopened,labeled,unlabeled] +permissions: read-all +jobs: + buf-pr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Buf setup + uses: bufbuild/buf-setup-action@v1 + with: + version: 1.32.0-beta.1 + - run: buf --version + - name: Buf build + run: buf build . --error-format github-actions + - name: Buf format + if: ${{ !contains(github.event.pull_request.labels.*.name, 'Buf Skip Format') }} + run: buf format . --diff --error-format github-actions --exit-code + - name: Buf lint + if: ${{ !contains(github.event.pull_request.labels.*.name, 'Buf Skip Lint') }} + run: buf lint . --error-format github-actions + - name: Checkout base + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.sha }} + path: .base + - name: Buf breaking + if: ${{ !contains(github.event.pull_request.labels.*.name, 'Buf Skip Breaking') }} + run: buf breaking . --error-format github-actions --against .base diff --git a/.github/workflows/buf-push-checks.yaml b/.github/workflows/buf-push-checks.yaml new file mode 100644 index 0000000..27d7d5d --- /dev/null +++ b/.github/workflows/buf-push-checks.yaml @@ -0,0 +1,32 @@ +name: Buf push checks +on: + push: + branches: + - main +permissions: read-all +jobs: + buf-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Buf setup + uses: bufbuild/buf-setup-action@v1 + with: + version: 1.32.0-beta.1 + - run: buf --version + - name: Buf build + run: buf build . --error-format github-actions + - name: Buf format + if: ${{ !contains(github.event.head_commit.message, 'buf skip format') }} + run: buf format . --diff --error-format github-actions --exit-code + - name: Buf lint + if: ${{ !contains(github.event.head_commit.message, 'buf skip lint') }} + run: buf lint . --error-format github-actions + - name: Checkout base + uses: actions/checkout@v4 + with: + ref: ${{ gihub.event.before }} + path: .base + - name: Buf breaking + if: ${{ !contains(github.event.head_commit.message, 'buf skip breaking') }} + run: buf breaking . --error-format github-actions --against .base diff --git a/.github/workflows/buf-push.yaml b/.github/workflows/buf-push.yaml new file mode 100644 index 0000000..11e175a --- /dev/null +++ b/.github/workflows/buf-push.yaml @@ -0,0 +1,16 @@ +name: Buf push +on: + push +permissions: read-all +jobs: + buf-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Buf setup + uses: bufbuild/buf-setup-action@v1 + with: + version: 1.32.0-beta.1 + - run: buf --version + - name: Buf push + run: buf push . --error-format=github-actions --git-metadata