{"id":18310903,"url":"https://github.com/jimschubert/yizzy","last_synced_at":"2025-06-22T06:04:06.113Z","repository":{"id":139902480,"uuid":"344277964","full_name":"jimschubert/yizzy","owner":"jimschubert","description":"YAML migrations","archived":false,"fork":false,"pushed_at":"2021-03-06T17:39:07.000Z","size":46,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T06:03:59.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimschubert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jimschubert","patreon":"jimschubert"}},"created_at":"2021-03-03T22:12:15.000Z","updated_at":"2021-03-07T21:43:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"041d9fb0-a3d2-41ea-896b-9844812312eb","html_url":"https://github.com/jimschubert/yizzy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jimschubert/yizzy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fyizzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fyizzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fyizzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fyizzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimschubert","download_url":"https://codeload.github.com/jimschubert/yizzy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fyizzy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261243996,"owners_count":23129639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T16:15:50.279Z","updated_at":"2025-06-22T06:04:01.080Z","avatar_url":"https://github.com/jimschubert.png","language":"Go","funding_links":["https://github.com/sponsors/jimschubert","https://patreon.com/jimschubert"],"categories":[],"sub_categories":[],"readme":"# yizzy\n\nYAML migrations using yq and selector syntax/operators. It can simplify DevOps administration of CI files written in YAML.\n\n* _Need to upgrade hundreds of CircleCI configs with complex logic?_ - **Get yizzy**.\n* _Want apply multiple changes consistently to all GitHub Workflows on your machine?_ - **Get yizzy**.\n* _Prefer awk/sed and bash scripting?_ - **Don't get yizzy**.\n\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue)](./LICENSE)\n![Go Version](https://img.shields.io/github/go-mod/go-version/jimschubert/yizzy)\n![Go](https://github.com/jimschubert/yizzy/workflows/Build/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jimschubert/yizzy)](https://goreportcard.com/report/github.com/jimschubert/yizzy)\n![Docker Pulls](https://img.shields.io/docker/pulls/jimschubert/yizzy)\n\u003c!-- [![codecov](https://codecov.io/gh/jimschubert/yizzy/branch/master/graph/badge.svg)](https://codecov.io/gh/jimschubert/yizzy) --\u003e \n\n## Installation\n\n### Binaries\n\nLatest binary releases are available via [GitHub Releases](https://github.com/jimschubert/yizzy/releases).\n\n### Homebrew\n\nIf you prefer homebrew, I got you.\n\n```\nbrew install jimschubert/tap/yizzy\n```\n\nor:\n\n```\nbrew tap jimschubert/tap\nbrew install yizzy\n```\n\n## Usage\n\n```shell\n$ yizzy -h\nUsage:\n  yizzy [OPTIONS]\n\nApplication Options:\n  -f, --file=FILE    The file to process\n  -d, --dir=         The directory where migrations reside\n      --in-place     Writes a file in place\n  -v, --version      Display version information\n\nHelp Options:\n  -h, --help         Show this help message\n```\n\n### Migration document(s)\n\nA migration document holds the list of operations and environments we intend to apply to a target file. The document applies one or more \n[expressions as supported by yq](https://mikefarah.gitbook.io/yq/) against a YAML document. \n\n####  Migration: `operations`\n\nAn operation consists of:\n\n* `value_type`: an optional, defining the [YAML type](https://yaml.org/type/) which will be applied by `value` or `eval`\n* `value`: a scalar or literal value which does not require document traversal or evaluation\n* `eval`: an expression requiring traversal or [yq operations](https://mikefarah.gitbook.io/yq/operators) evaluated in the\n  context defined by `selector` (or the document root by default)\n* `selector`: a [yq](https://mikefarah.gitbook.io/yq/) expression targeting one or more nodes on which to operate contextually\n  when applying the `value` or `eval` result\n  \n#### Migration: `env`\n\nThe `env` node is a simple map of keys representing the environment variable to be set during evaluation of each operation,\nand an expression to apply whenever that environment variable is referenced via yq's [env variable operators](https://mikefarah.gitbook.io/yq/operators/env-variable-operators).\n\n**NOTE** A literal reference defined within the YAML document must result in an expression wrapped in quotes. In YAML, this\nwill be the following syntax:\n\n```\nLITERAL_ENV: '\"Jim Schubert\"'\n```\n\nThis creates an expression of `\"Jim Schubert\"`. One set of single/double quotes would result in an unquoted expression `Jim Schubert`,\nwhich would cause a parser error in yq.\n\n#### Example\n\nCreate a directory called `migrations`, and create a dated YAML file within this directory. For example: `2021-03-05.yml`:\n\n```yaml\nenv:\n  FIRST_NAME: .bill-to.given\n  LAST_NAME: .bill-to.family\noperations:\n  - selector: .ship-to\n    eval: '.full_name = strenv(FIRST_NAME) + \" \" + strenv(LAST_NAME)'\n    value_type: '!!str'\n```\n\nA migration document contains an optional map named `env`, a key/value mapping of environment variable names which will\nbe passed to each operation, and a selector evaluated against the input document prior to operations. These operations are\napplied in declaration order.\n\nSee [testdata](./testdata) for examples of migrations and their expectations once applied to the YAML 1.2 specification's `invoice.yaml`.\n\n## Contributors\n\n### Build\n\nBuild a local distribution for evaluation using latest [goreleaser](https://goreleaser.com/).\n\n```bash\ngoreleaser release --skip-publish --snapshot --rm-dist\n```\n\nThis will create an executable application for your os/architecture under `dist`:\n\n```\ndist\n├── yizzy_darwin_amd64\n│   └── yizzy\n├── yizzy_linux_386\n│   └── yizzy\n├── yizzy_linux_amd64\n│   └── yizzy\n├── yizzy_linux_arm64\n│   └── yizzy\n├── yizzy_linux_arm_6\n│   └── yizzy\n└── yizzy_windows_amd64\n    └── yizzy.exe\n```\n\nBuild and execute locally:\n\n* Get dependencies\n  ```shell\n  go get -d ./...\n  ```\n* Build\n  ```shell\n  go build -o yizzy cmd/main.go\n  ```\n* Run\n  ```shell\n  ./yizzy --help\n  ```\n### Linting\n\n1. Install [golangci-lint](https://golangci-lint.run/usage/install/#local-installation).\n2. Run it: `golangci-lint run ./...`\n\n## License\n\nThis project is [licensed](./LICENSE) under Apache 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fyizzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimschubert%2Fyizzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fyizzy/lists"}