Skip to content

playstudios/action-gitops-update-yaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Action - Update Yaml

This repository contains a Github action to update values within a yaml file in a remote repository. It can also be used as a library within other go applications.

Usage as a Github Action

... todo

Usage as a library

The following yaml

path:
    to:
      the:
        - value: hello
        - value: world
      nested: |
        abc: 123

and example

repo, err := git.CloneGithub("playstudios/my-repo", "abc123")
file, err := repo.ReadFile("my/file/name.yaml")

document, err := document.Parse(file)
err = document.Set("path.to.the.1.value", "universe")
err = document.Set("path.to.nested.abc", 456)
err = document.Write(file)

err = repo.Commit("updated something")

outputs

path:
    to:
      the:
        - hello: bob?
        - hello: universe
      nested: |
        abc: 456

About

Github action for updating values in a yaml file

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages