Skip to content

jimmymcpeter/setup-powershell-yaml

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

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setup-powershell-yaml

This GitHub Action will download, install, and cache the powershell-yaml module from PowerShell Gallery.

Usage

See action.yml

uses: jimmymcpeter/setup-powershell-yaml@v1
with:
  # Version to setup. Latest version is setup if not specified. Setting a version will be fastest.
  # See https://www.powershellgallery.com/packages/powershell-yaml
  version: ""

Basic:

- name: Setup powershell-yaml
  uses: jimmymcpeter/setup-powershell-yaml@v1
  with:
    version: "0.4.12"

- name: Use powershell-yaml
  id: parse-yaml
  shell: pwsh
  run: |
    $data = "hello: world"
    $yml = ConvertFrom-Yaml -Yaml "$data"
    $json = ConvertTo-Yaml -JsonCompatible -Data $yml;
    echo "json_out=$json" >> $ENV:GITHUB_OUTPUT

- name: Use the JSON
  shell: pwsh
  env:
    HELLO: ${{ fromJSON(steps.parse-yaml.outputs.json_out).hello }}
  run: |
    echo "Hello ${{ env.HELLO }}!"

About

Setup powershell-yaml for use in GitHub Actions

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •