add `--tag` option
The "iterate on modules" doc shows the --tag option.
I'd like that as an option for this action.
Thanks!
@TonyPapousekLC The buf-push-action always includes the Git commit as the --tag. Were you thinking that you'd like to override that behavior?
@marekbuild - Yup, my team sets that field as the project semver
I second this, needed for the exact same reason, thanks.
@sachaw can you propose what you'd like to see exactly? ie what you want added to the configuration, what the behavior should be, get as detailed as you can. We'd like to consider this.
Hey we'd love this option too, I see the current action sets it to --tag ${{ github.sha }}, if it was me my suggestion would be to add an input with that as the default e.g.:
inputs:
tag:
required: false
type: string
default: ${{ github.sha }}
Then replace the existing step to have: WANT_ARGS: push path/to/input --tag ${{ inputs.tag }}
With the suggestion above, then in our own case we would be able to use it as:
- uses: bufbuild/buf-push-action@v1
with:
input: <path-to-protos>
buf_token: ${{ secrets.buf_token }}
tag: ${{ github.sha }},<other-tag>,<even-more-tags>
Any progress so far? We are also using semver so we have to maintain own fork for that. There is already PR #36 created
Hey all, we are actively working on two things related to this:
- We will be making some changes to how tags are going to work in the BSR. It will be backwards compatible, but want to let those changes ship before we would consider adding support for tags here.
- We plan on making some changes to how these GitHub actions work, probably simplifying everything to a single action.
Given that, we are going to hold off on making further changes right now to these actions until some of these other changes are complete.
This has been sitting for a bit. I ended up here with the same ask. Any way we can get a quick update to this action? Seems like a pretty simple thing to solve for.
The update here is we are investing in a new unified GitHub action. It is in an alpha state here: https://github.com/bufbuild/buf-action so you are welcome to try it out. We are already dogfooding it internally and have received positive feedback from a few other customers.
@nicksnyder where I can left feedback to that new action? I noticed 2 issues
- Missing documentation for
github_tokenas I see in the code it is used, but it is not documented in the README - That
tagoption during push is not available there too. So no benefits to migrate there now
You can file issues on the buf-action repo.
Missing documentation for github_token as I see in the code it is used, but it is not documented in the README
Thanks, we'll add docs for those.
That tag option during push is not available there too. So no benefits to migrate there now
Tags and Branches are deprecated as of v1.32.0 of the buf CLI. We now have a single concept called Labels (which is backward compatible with Tags and Branches).
The new action automatically adds a label for each git ref that points to the git commit you are pushing to the BSR, so if you are tagging with semver Git tags, then those will automatically get pushed to the BSR (without the need for any manual configuration). Does that solve your use case?
Here are some blog posts that explain the changes:
- https://buf.build/blog/buf-cli-next-generation
- https://buf.build/blog/enhanced-buf-push-bsr-ui
@nicksnyder thanks for the reply. I will need to test it out. It should work as you described it, but I'm not 100% sure as our trigger is repository_dispatch, not push.
When we merge changes to master branch, they are not pushed to BSR automatically. But after our code reach production, we are using Github API to trigger that workflow, with semver tag as payload.
Our pipeline looks like this (very simplified):
---
name: Push Proto changes to buf.build
on:
repository_dispatch:
types: [publish_proto] # Do not rename type as this is identifier in external cURL call
jobs:
buf-push:
strategy:
matrix:
repos:
- {fullName: indykite/indykiteapis, folder: proto/public}
- {fullName: indykite/internalapis, folder: proto/internal}
runs-on: ubuntu-latest
steps:
# ...
- if: ${{ steps.diff_checker.outputs.has_diff }}
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.INDYKITEONE_PAT }}
- if: ${{ steps.diff_checker.outputs.has_diff }}
uses: bufbuild/buf-lint-action@v1
with:
input: ${{matrix.repos.folder}}
- if: ${{ steps.diff_checker.outputs.has_diff }}
uses: bufbuild/buf-push-action@v1
with:
buf_token: ${{ secrets.BUF_TOKEN }}
input: ${{matrix.repos.folder}}
tag: ${{ steps.get-tag.outputs.new_tag }}
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
@arxeiss The push action is really just a thin wrapper around buf push, so it is just as easy, if not simpler, to call buf push directly.
- uses: bufbuild/buf-push-action@v1
- with:
- buf_token: ${{ secrets.BUF_TOKEN }}
- input: ${{matrix.repos.folder}}
- tag: ${{ steps.get-tag.outputs.new_tag }}
+ run: buf push ${{ matrix.repos.folder }} --label ${{ steps.get-tag.outputs.new_tag }} --label main
Note: I made an assumption here that you want to push each new commit to both the semver tag as well as the BSR label main (which is what buf push --tag <semver> would do)
The new buf-action has been released as a v1 with improved support for push, ensuring branches kept in sync with the BSR. Please take a look and raise any issues found there! Happy to help on buf slack or GitHub issues for any setup help in migrating buf-push-action to the new action.