-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix push with no configured module names #31
Conversation
Read the config file to determine if a module name is present before trying to push to the remote. On no configured modules skip both push and archive steps.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test that has two modules in the workspace, one with a name and one without?
Need to fix multi-module pushes. We should push only named modules. |
788fdfb
to
9f7e88e
Compare
outputs: | ||
buf_version: | ||
description: |- | ||
Version of the Buf CLI used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unrelated change. Originally planned to use it to read back the version in different locations, but went with passing args. It does seem useful to provide outputs for other actions with the version being used supported by most actions.
const args = ["push", "--error-format", "github-actions"]; | ||
// Add --exclude-unnamed on buf versions that support the flag. | ||
if (semver.satisfies(bufVersion, ">=1.33.0")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we 1.0 this action, I would be in favor of just bumping the required minimum version of the whole action to 1.33.0 so we can eliminate this check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, any version bumps we can increase the min version on. Left here to allow for a patch on 0.1.
This PR allows for better push behaviour when unnamed modules are present. The action will now read the
buf.yaml
config file to check for missing names before running the push or archive steps. With the latest release ofbuf
@v.1.33.0 we can now also use the flag--exclude-unnamed
to avoid failing push on unnamed modules when multiple modules are present.As a test (and example) see the
test-push-unnamed
step in CI:In addition is the introduction of outputs in the
action.yml
by setting the resolved version ofbuf
.