Refactor Buf login command in GitHub Actions workflow to improve toke… #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Buf Push | |
| on: | |
| push: | |
| branches: | |
| - master | |
| create: | |
| tags: | |
| - v* # Trigger on tags starting with 'v', adjust if your tags differ | |
| jobs: | |
| buf-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: bufbuild/buf-setup-action@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} # Optional: Recommended for fetching private dependencies | |
| - name: Log in to Buf Schema Registry | |
| run: echo ${{secrets.BUF_TOKEN}} | buf registry login ${{ secrets.BUF_USER }} --token-stdin | |
| - name: Push schema to Buf Schema Registry | |
| run: buf push |