From 5442ab18a228409493575f66f1896f7179b00a5b Mon Sep 17 00:00:00 2001 From: Doria Keung Date: Wed, 16 Oct 2024 15:23:30 -0400 Subject: [PATCH] Use new buf-action --- .github/workflows/buf.yaml | 23 ++++++++++------------- .github/workflows/ci.yaml | 19 +++---------------- github-actions/README.md | 13 +++---------- 3 files changed, 16 insertions(+), 39 deletions(-) diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml index 3ef1389..a7390bc 100644 --- a/.github/workflows/buf.yaml +++ b/.github/workflows/buf.yaml @@ -8,26 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1 - with: - github_token: ${{ github.token }} - - uses: bufbuild/buf-push-action@v1 + - uses: bufbuild/buf-action@v1 with: input: 'limit-output-types' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'linting/bad' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'linting/good' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'workspace/observabilitytypes' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'workspace/observabilityapi' - buf_token: ${{ secrets.BUF_TOKEN }} + token: ${{ secrets.BUF_TOKEN }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 764c906..a408f19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,23 +4,10 @@ jobs: lint-and-breaking-change-detection: runs-on: ubuntu-latest steps: - # Run `git checkout` - name: Checkout uses: actions/checkout@v4 - # Install the `buf` CLI - - name: Setup - uses: bufbuild/buf-setup-action@v1 - with: - github_token: ${{ github.token }} - # Lint the Buf module in the `github-actions` directory - - name: Lint - uses: bufbuild/buf-lint-action@v1 - with: - input: github-actions - # Detect breaking changes for the Buf module in the `github-actions` directory - # against the current `main` branch - - name: Breaking change detection against `main` - uses: bufbuild/buf-breaking-action@v1 + - name: Buf Action + uses: bufbuild/buf-action@v1 with: input: github-actions - against: https://github.com/bufbuild/buf-examples.git#branch=main,ref=HEAD~1,subdir=github-actions + token: ${{ secrets.BUF_TOKEN }} diff --git a/github-actions/README.md b/github-actions/README.md index 518dc4c..c066210 100644 --- a/github-actions/README.md +++ b/github-actions/README.md @@ -2,18 +2,11 @@ [![GitHub Actions](https://github.com/bufbuild/buf-examples/workflows/CI/badge.svg)](https://github.com/bufbuild/buf-examples/actions?workflow=CI) -This example project shows you how to use Buf in a [GitHub Actions][actions] setting. The Actions pipeline here involves three Buf-specific GitHub Actions: - -* [`buf-setup-action`][buf-setup] installs the [`buf` CLI][cli] -* [`buf-lint-action`][buf-lint] [lints][lint] this Protobuf module -* [`buf-breaking-action`][buf-breaking] runs [breaking change detection][breaking] against the current `main` branch +This example project shows you how to use Buf in a [GitHub Actions][actions] setting. +This uses the [Buf Action][buf-action]. > The configuration for [GitHub Actions][actions] is in the [`.github`](../.github) directory in the root, as that's where GitHub expects it to be. [actions]: https://docs.github.com/actions -[breaking]: https://docs.buf.build/breaking -[buf-breaking]: https://github.com/bufbuild/buf-breaking-action -[buf-lint]: https://github.com/bufbuild/buf-lint-action -[buf-setup]: https://github.com/bufbuild/buf-setup-action +[buf-action]: https://github.com/marketplace/actions/buf-action [cli]: https://github.com/bufbuild/buf -[lint]: https://docs.buf.build/lint