From 251f69be6ff84731c0e7a76443bceb01d8bbf58a Mon Sep 17 00:00:00 2001 From: Edward McFarlane <3036610+emcfarlane@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:22:51 -0400 Subject: [PATCH] Update buf CI GitHub action (#933) Update the GitHub action to use `buf-action`. This has improved support for handling syncing GitHub repositories with the BSR. See the [default behaviour](https://github.com/bufbuild/buf-action?tab=readme-ov-file#default-behavior). Changes include: - On each push to the repository the event will be synced. This includes the git-metadata of the push. - Formatting has been added as a check. --- .github/workflows/buf-ci.yaml | 28 ++++++++++++++++++++++++ .github/workflows/buf.yaml | 40 ----------------------------------- 2 files changed, 28 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/buf-ci.yaml delete mode 100644 .github/workflows/buf.yaml diff --git a/.github/workflows/buf-ci.yaml b/.github/workflows/buf-ci.yaml new file mode 100644 index 00000000..0fb7ce7b --- /dev/null +++ b/.github/workflows/buf-ci.yaml @@ -0,0 +1,28 @@ +name: Buf CI +on: + push: + paths: + - '**.proto' + - '**/buf.yaml' + - '**/buf.lock' + - '**/buf.md' + - '**/README.md' + - '**/LICENSE' + - '.github/workflows/buf-ci.yaml' + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + delete: +permissions: + contents: read + pull-requests: write +jobs: + buf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: bufbuild/buf-action@v1 + with: + input: proto + breaking_against: 'buf.build/connectrpc/conformance' + token: ${{ secrets.BUF_TOKEN }} + diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml deleted file mode 100644 index 9fc2b17f..00000000 --- a/.github/workflows/buf.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: buf -on: - push: - branches: [main] - paths: ['proto/**', '.github/workflows/buf.yaml'] - pull_request: - branches: [main] - paths: ['proto/**', '.github/workflows/buf.yaml'] - workflow_dispatch: {} # support manual runs -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1 - - uses: bufbuild/buf-lint-action@v1.1.1 - with: - input: proto - breaking: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1 - - uses: bufbuild/buf-breaking-action@v1.1.4 - with: - input: proto - against: 'buf.build/connectrpc/conformance' - push: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - needs: - - lint - - breaking - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1 - - uses: bufbuild/buf-push-action@v1.2.0 - with: - input: 'proto' - buf_token: ${{ secrets.BUF_TOKEN }}