home.social

#yq — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #yq, aggregated by home.social.

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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)`.

    #openapi #yq #yaml #openapigenerator

  7. 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)`.

    #openapi #yq #yaml #openapigenerator

  8. 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)`.

    #openapi #yq #yaml #openapigenerator

  9. 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)`.

    #openapi #yq #yaml #openapigenerator

  10. 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)`.

    #openapi #yq #yaml #openapigenerator

  11. 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 :)

    #openapi #sed #yq #openapigenerator

  12. 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 :)

    #openapi #sed #yq #openapigenerator

  13. 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 :)

    #openapi #sed #yq #openapigenerator

  14. 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 :)

    #openapi #sed #yq #openapigenerator

  15. 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 :)

    #openapi #sed #yq #openapigenerator

  16. So.. looked into this OpenAPI thing to query an API and eventually found a fancy tool - openapi-generator - 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...

    #openapi #yq #sed

  17. So.. looked into this OpenAPI thing to query an API and eventually found a fancy tool - openapi-generator - 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...

    #openapi #yq #sed

  18. So.. looked into this OpenAPI thing to query an API and eventually found a fancy tool - openapi-generator - 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...

    #openapi #yq #sed

  19. So.. looked into this OpenAPI thing to query an API and eventually found a fancy tool - openapi-generator - 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...

    #openapi #yq #sed

  20. So.. looked into this OpenAPI thing to query an API and eventually found a fancy tool - openapi-generator - 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...

    #openapi #yq #sed

  21. CW: shell script in post

    YAML to XLSX pipeline 🙈

    This was fun, but I don't want to do it again.

    curl -s raw.githubusercontent.com/AKVo \
    | 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

  22. CW: shell script in post

    YAML to XLSX pipeline 🙈

    This was fun, but I don't want to do it again.

    curl -s raw.githubusercontent.com/AKVo \
    | 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

  23. CW: shell script in post

    YAML to XLSX pipeline 🙈

    This was fun, but I don't want to do it again.

    curl -s raw.githubusercontent.com/AKVo \
    | 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

  24. CW: shell script in post

    YAML to XLSX pipeline 🙈

    This was fun, but I don't want to do it again.

    curl -s raw.githubusercontent.com/AKVo \
    | 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

  25. CW: shell script in post

    YAML to XLSX pipeline 🙈

    This was fun, but I don't want to do it again.

    curl -s raw.githubusercontent.com/AKVo \
    | 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

  26. #HoyAprendí que existe "yq", una aplicación para línea de comandos, que permite procesar archivos YAML usando la misma sintaxis que usa "jq", al procesar archivos JSON.

    Me está sirviendo para leer configuraciones complejas para scripts en Bash.

    mikefarah.gitbook.io/yq

    #yq #bash #scripting

  27. #HoyAprendí que existe "yq", una aplicación para línea de comandos, que permite procesar archivos YAML usando la misma sintaxis que usa "jq", al procesar archivos JSON.

    Me está sirviendo para leer configuraciones complejas para scripts en Bash.

    mikefarah.gitbook.io/yq

    #yq #bash #scripting

  28. #HoyAprendí que existe "yq", una aplicación para línea de comandos, que permite procesar archivos YAML usando la misma sintaxis que usa "jq", al procesar archivos JSON.

    Me está sirviendo para leer configuraciones complejas para scripts en Bash.

    mikefarah.gitbook.io/yq

    #yq #bash #scripting

  29. 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 pbs.bartificer.net/pbs169

    #Programming #ProgrammingByStealth #YAML #yq

  30. 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 pbs.bartificer.net/pbs169

    #Programming #ProgrammingByStealth #YAML #yq

  31. 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 pbs.bartificer.net/pbs169

    #Programming #ProgrammingByStealth #YAML #yq

  32. 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 pbs.bartificer.net/pbs169

    #Programming #ProgrammingByStealth #YAML #yq

  33. 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 pbs.bartificer.net/pbs169

    #Programming #ProgrammingByStealth #YAML #yq

  34. 🆕 📜: 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

    maw.sh/blog/get-webmention-wit

  35. 🆕 📜: 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

    maw.sh/blog/get-webmention-wit

    #pandoc #shell #posix #jq #yq #webmention #indieweb #linux

  36. 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!

  37. 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

  38. 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)"

  39. 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)"

  40. 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)"

  41. 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)"

  42. 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)"

  43. Hello Fediverse, why did nobody tell me about #YQ ?
    #jq #json #yaml #xml
    yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents
    kislyuk.github.io/yq/

  44. Hello Fediverse, why did nobody tell me about #YQ ?
    #jq #json #yaml #xml
    yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents
    kislyuk.github.io/yq/

  45. Hello Fediverse, why did nobody tell me about #YQ ?
    #jq #json #yaml #xml
    yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents
    kislyuk.github.io/yq/