Skip to content

rmeneely/get-yaml-value

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

get-yaml-value

This GitHub Action returns a list of YAML file values

Usage

    - uses: rmeneely/get-yaml-value@v1
      with:
        # Infile. The YAML file to be read
        # Default: 'values.yaml'
        # Optional
        infile: 'values.yaml
        # varlist - a comma separated list of variables. e.g version,image.tag
        # Default: ''
        # Required
        varlist: ''
        # exclude_varname - Exclude the variable name in the returned values. Note the values returned are in the order they are found. This is intended for single variable queries.
        # Default: false
        # Optional
        exclude_varname: false

Examples

    # Returns the image tag in values.yaml file
    # Example: 
    - uses: rmeneely/get-yaml-value@v1
      with:
        infile: values.yaml
        varlist: 'image.tag'
    # Returns the appVersion and version in Chart.yaml
    # Example: 
    - uses: rmeneely/get-yaml-value@v1
      with:
        infile: Chart.yaml
        varlist: appVersion,version
    # Returns a dependency version in Chart.yaml from within a list of dependencies
    # Example: 
    - uses: rmeneely/get-yaml-value@v1
      with:
        infile: Chart.yaml
        varlist: dependencies[name=myapp].version"

This will return the dependencies.version where that same list item has dependencies.name set to 'myapp'. Caveat: Does not support multiple variable[condition].variable formats within the same query

Output

steps.get-yaml-value.outputs.values - Set to comma separated list of <variable>=<value>

License

The MIT License (MIT)

About

Returns a YAML file variable value

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages