#yq — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #yq, aggregated by home.social.
-
Turns out that not only do Actions runners come with jq preinstalled, but yq is there too.
hollycummins.com/using-yq-in-g…
There was a featured snippet for “is yq available on GitHub actions,” which directed me to a marketplace installer. The yq project itself had a marketplace installer. Clearly, I needed to install it before using it. Right?
My colleague George Gastaldi looked at what I’d done, and pointed out yq was available on the runners. This matters, because we try and limit our use of external, ‘non-official’ actions, for supply chain security reasons.
So I searched again to confirm, and … still found very little. To actually confirm, I had to merge and experiment. And, indeed, the GitHub runners do come with yq pre-installed. They’ve had yq since 2021.
#yaml #yq #jq #GithubActions
#CICD
#ContinuousIntegration
#ContinuousDeployment -
Turns out that not only do Actions runners come with jq preinstalled, but yq is there too.
hollycummins.com/using-yq-in-g…
There was a featured snippet for “is yq available on GitHub actions,” which directed me to a marketplace installer. The yq project itself had a marketplace installer. Clearly, I needed to install it before using it. Right?
My colleague George Gastaldi looked at what I’d done, and pointed out yq was available on the runners. This matters, because we try and limit our use of external, ‘non-official’ actions, for supply chain security reasons.
So I searched again to confirm, and … still found very little. To actually confirm, I had to merge and experiment. And, indeed, the GitHub runners do come with yq pre-installed. They’ve had yq since 2021.
#yaml #yq #jq #GithubActions
#CICD
#ContinuousIntegration
#ContinuousDeployment -
Turns out that not only do Actions runners come with jq preinstalled, but yq is there too.
hollycummins.com/using-yq-in-g…
There was a featured snippet for “is yq available on GitHub actions,” which directed me to a marketplace installer. The yq project itself had a marketplace installer. Clearly, I needed to install it before using it. Right?
My colleague George Gastaldi looked at what I’d done, and pointed out yq was available on the runners. This matters, because we try and limit our use of external, ‘non-official’ actions, for supply chain security reasons.
So I searched again to confirm, and … still found very little. To actually confirm, I had to merge and experiment. And, indeed, the GitHub runners do come with yq pre-installed. They’ve had yq since 2021.
#yaml #yq #jq #GithubActions
#CICD
#ContinuousIntegration
#ContinuousDeployment -
Turns out that not only do Actions runners come with jq preinstalled, but yq is there too.
hollycummins.com/using-yq-in-g…
There was a featured snippet for “is yq available on GitHub actions,” which directed me to a marketplace installer. The yq project itself had a marketplace installer. Clearly, I needed to install it before using it. Right?
My colleague George Gastaldi looked at what I’d done, and pointed out yq was available on the runners. This matters, because we try and limit our use of external, ‘non-official’ actions, for supply chain security reasons.
So I searched again to confirm, and … still found very little. To actually confirm, I had to merge and experiment. And, indeed, the GitHub runners do come with yq pre-installed. They’ve had yq since 2021.
#yaml #yq #jq #GithubActions
#CICD
#ContinuousIntegration
#ContinuousDeployment -
Turns out that not only do Actions runners come with jq preinstalled, but yq is there too.
hollycummins.com/using-yq-in-g…
There was a featured snippet for “is yq available on GitHub actions,” which directed me to a marketplace installer. The yq project itself had a marketplace installer. Clearly, I needed to install it before using it. Right?
My colleague George Gastaldi looked at what I’d done, and pointed out yq was available on the runners. This matters, because we try and limit our use of external, ‘non-official’ actions, for supply chain security reasons.
So I searched again to confirm, and … still found very little. To actually confirm, I had to merge and experiment. And, indeed, the GitHub runners do come with yq pre-installed. They’ve had yq since 2021.
#yaml #yq #jq #GithubActions
#CICD
#ContinuousIntegration
#ContinuousDeployment -
So, in order to do the cleanups, I can use `yq`'s excellent filtering abilities. For example I have a list of verbatim API endpoints like `/token` and `/endpoint/{id}` in `allowed_apis.lst`:
```
yq '(load_str("allowed_apis.lst") | split("\n")) as $l | .paths |= with_entries(select(.key as $k | $l | any_c(. == $k)))' api.yaml > api_cleaned_paths.yaml
```And similar approach for models, except for `any_c(..)` I have to use `all_c(. != $k)`.
-
So, workflow is following:
0. Manually fix the OpenAPI `bundle.yaml` - this was actually something that caused the tool to exit with error...
1. Filter out unwanted APIs with `yq`
2. Run the openapi-generator-cli validator to get the list of unused models/types
3. Use `sed` to parse the list of unused models/types
4. Use `yq` again to filter out the unneeded models.
5. Generate the "minimum" client and models :) -
So.. looked into this OpenAPI thing to query an API and eventually found a fancy tool - openapi-generator - https://openapi-generator.tech/.
With this I can generate a ton of useful boilerplate in almost every programming language.But what if I only want to communicate only two of the endpoints?!
So, over a few days I've been part-time tinkering with `yq` and `sed` to cut down the autogenerated code to include just the minimum by filtering out the unwanted APIs and data types...
-
CW: shell script in post
YAML to XLSX pipeline 🙈
This was fun, but I don't want to do it again.
curl -s https://raw.githubusercontent.com/AKVorrat/dearmep/refs/heads/main/server/dearmep/example-config.yaml \
| uvx yq '(.l10n.strings + .l10n.frontend_strings) | to_entries | map(select(.value | type == "object")) | map({id: .key} + .value)' \
| uvx --from csvkit in2csv -f json > strings.csv \
&& libreoffice --headless --infilter=CSV:44,34,76,1 --convert-to xlsx strings.csv#YAML #CSV #XSLX #jq #yq #CSVKit #LibreOffice #CLI #ShellScript #bash
-
Programming By Stealth is officially spun off as a standalone podcast with new music, a new intro, and a direct link to @bart’s fabulous tutorial shownotes!
Instalment 169 of X — Advanced YAML Topics https://pbs.bartificer.net/pbs169
-
🆕 📜: Get webmentions with shell script using jq & yq
Here is my new blog post of how I manage on website to fetch and sync new webmentions, using shell script and `jq` and `yq` to parse and set the data
-
Transcripción de la charla "Conectando Soluciones" de OSiUX en FLISoL CABA 2024
#Bash #Boxart #Charla #Consola #Debian #Eventol #FLISoL #Git #GraphViz #grep #ImageMagick #Journal #jq #jrnl #JSON #Linux #Markdown #RegEx #shellrun #Shellrun #Talk #Terminal #TTY #txt2md #Vim #yq
https://osiux.com/2024-04-27-flisol-caba-2024-conectando-soluciones.html
-
I'm making a concerted effort to switch flat config files to formatted YAML in my various scripts and utilities. I've been using Mike Farah's yq for my random shell scripts, excellent!
#yaml #developer #shell #yq -
I half sort of found a way to do this with #Infisical and #yq, by using props annotation and parsing it through yq:
infisical export --env=dev -fyaml | yq -pprops -o yaml
This get it's into properly formatted yaml. yq can also do the same in the opposite direction to import back into infisical.
And to support having .'s in keys, use \\x2e and pass it through echo:
echo -e "$(infisical export --env=dev -fyaml | yq -pprops -o yaml)"
-
Whoop whoop - yq is kinda "jq for yaml" :
https://mikefarah.gitbook.io/yq
Bonus : yq ist able to transform json to yaml and vice versa 🤟
-
Whoop whoop - yq is kinda "jq for yaml" :
https://mikefarah.gitbook.io/yq
Bonus : yq ist able to transform json to yaml and vice versa 🤟
-
I don't know if I'm learning #jq syntax or just making a collection of usable queries, but here's one for yaml from today.
To pull the #kubectl config for the user(s) with "prod" in the name:
yq '.users.[] | select(.name|contains("prod"))' $home\.kube\config
That's https://github.com/mikefarah/yq
#yq doesn't (yet) support _all_ of jq's syntax, but it supports everything I've needed, and it works on yaml AS WELL AS on json...
-
@skunksarebetter If you do a lot of work around #K8s, #yq should definitely be in your digital toolbox!
#Kubernetes -
#yq is a #CLI #YAML processor.
yq is a preprocessor for #jq which converts YAML into JSON, processes the data with standard jq, finally outputting YAML. yq has the ability to preserve custom tags and formatting, allowing for more accurate round-trip processing. yq also includes #xq for #XML, and #tomlq for #TOML.
Website 🔗️: https://github.com/kislyuk/yq
-
yq is a command line program that takes in YAML data and runs an expression against it, like #sed. yq programs can be made up of many operators, including simple accessors, assignment operators, arithmetic, sorting, recursive globbing, and more. yq can also process #JSON, as it is a subset of YAML.
Website 🔗️: https://github.com/mikefarah/yq
#free #opensource #foss #fossmendations #programming #sysadmin #jq
-
#TodayILearned about #yq and especially #xq for parsing #YAML and #XML from the command-line as if it were #JSON parsed with #jq.
yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents by Andrey Kislyuk
#CLI #CommandLine #CommandLineInterface #terminal #tools #TIL