Skip to content

setup-powershell-yaml

Actions
Setup powershell-yaml for use in GitHub Actions
v1.0.0
Latest
Star (1)

Tags

 (1)

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 }}!"

setup-powershell-yaml is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Setup powershell-yaml for use in GitHub Actions
v1.0.0
Latest

Tags

 (1)

setup-powershell-yaml is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.