bazel-lib
bazel-lib copied to clipboard
Support stamping on yq rule
Useful for things like producing a package.json file that has the version field set from git tags.
Reopening to track the similar thing for yq (though I don't intend to do that now - the rules_js release story doesn't need it)
This would be great to support tag stamping in rules_oci via yq. The jq toolchain is not available on macOS with M1 or linux with arm64.
Hi guys, Big thanks for this feature very vey useful!!
I've tried it and i have an issue that i replicate here with a red test when running
bazel test --config=release //lib/tests/yq/...
It's unfortunately not working when i stamp a value from stable-status.txt when I use the release config with bazel.
For info i am running on Bazel 5.4.0
Yup, I can repro that, looks like the yq expression
load_str(filename) | split("\n") | .[]
| select(length!=0)
| [capture("(?P<key>[^\s]+)\s+(?P<value>.*)")]
only returns the first entry, which is why our tests for this passed.
Working like a charm :) Thanks guys!