build-buf.yml 1011 B

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Buf CI
  2. on:
  3. workflow_dispatch:
  4. push:
  5. paths:
  6. - 'proto/**'
  7. pull_request:
  8. types: [opened, synchronize, reopened, labeled, unlabeled]
  9. paths:
  10. - '.github/workflows/build-buf.yml'
  11. - 'proto/**'
  12. delete:
  13. permissions:
  14. contents: read
  15. pull-requests: write
  16. jobs:
  17. buf:
  18. runs-on: ubuntu-latest
  19. steps:
  20. - uses: actions/checkout@v4
  21. - name: Setup Go
  22. uses: actions/setup-go@v5
  23. with:
  24. go-version-file: 'service/go.mod'
  25. cache: true
  26. cache-dependency-path: 'service/go.mod'
  27. - uses: bufbuild/buf-action@v1.1.0
  28. with:
  29. token: ${{ secrets.BUF_TOKEN }}
  30. # Change setup_only to true if you only want to set up the Action and not execute other commands.
  31. # Otherwise, you can delete this line--the default is false.
  32. setup_only: false
  33. # Optional GitHub token for API requests. Ensures requests aren't rate limited.
  34. github_token: ${{ secrets.GITHUB_TOKEN }}