Giter Club home page Giter Club logo

yaml's Introduction

Yaml

This Github Action can be used to read, modify and write yaml files. Supports jsonpath to specify the paths to merge or set given data.

Example Usage

Modify a yaml file

jobs:
  modify-yaml:
    runs-on: ubuntu-latest
    name: Example job
    steps:
      - name: Checkout # checkout your sources
        uses: actions/checkout@v3
      - name: Modify yaml # use the action to modify yaml
        id: yaml-action
        uses: teunmooij/yaml@v1
        with:
          from-file: 'helm/values.yml'
          to-file: 'helm/values.yml'
          merge: { 'environment.secrets': { 'foo': 'bar', 'baz': 'qux' } }

Read data from a yaml file

jobs:
  read-yaml:
    runs-on: ubuntu-latest
    name: Example job
    steps:
      - name: Checkout # checkout your sources file
        uses: actions/checkout@v3
      - name: Read yaml # use the action to read yaml
        id: yaml-action
        uses: teunmooij/yaml@v1
        with:
          from-file: 'helm/values.yml'
     - name: Use data
        run: echo "Data ${{ steps.yaml-action.outputs.data }}"

Write data to a yaml file

jobs:
  read-yaml:
    runs-on: ubuntu-latest
    name: Example job
    steps:
      - name: Checkout # checkout your sources file
        uses: actions/checkout@v3
      - name: Write yaml # use the action to read yaml
        id: yaml-action
        uses: teunmooij/yaml@v1
        with:
          data: >-
            {
              "foo": "bar"
            }
          to-file: 'helm/values.yml'

Input

Argument Description Required
from-file Path to the file to read from true, if data is not provided
data The input data as JSON string true, if from-file is not provided
to-file Path to the file to write to false
merge Recursively merge the given data with the input data false
set Overwrite the input data at the given paths with the given data false

Output

Argument Description
data The output data

yaml's People

Contributors

teunmooij avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

yaml's Issues

Update to Node 20

Hello, when using this action there is a warning:

The following actions use a deprecated Node.js version and will be forced to run on node20: teunmooij/yaml@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.