44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: yq-convert
|
|
description: "Change the language format of a file."
|
|
inputs:
|
|
from:
|
|
#yaml, json, xml
|
|
description: "Format to convert from..."
|
|
required: true
|
|
to:
|
|
#yaml, json, xml
|
|
description: "Format to convert to..."
|
|
required: true
|
|
input:
|
|
#yaml, json, xml
|
|
description: "File or data to convert."
|
|
required: true
|
|
tmpDir:
|
|
description: "Temporary directory. Default: _tmp"
|
|
required: true
|
|
default: _tmp
|
|
outputs:
|
|
result:
|
|
description: "The converted file."
|
|
value: ${{ steps.convert.outputs.console }}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: "Make temporary file of input."
|
|
id: mktmp
|
|
uses: act/common/utils/mktemp@master
|
|
with:
|
|
input: ${{ inputs.input }}
|
|
tmpDir: ${{ inputs.tmpDir }}
|
|
- name: "Convert file."
|
|
id: convert
|
|
uses: act/common/yq/yq@master
|
|
with:
|
|
command: -p ${{ inputs.from }} -o ${{ inputs.to }} "${{ steps.mktmp.outputs.tmp }}"
|
|
# - name: "Take ownership of the artifacts."
|
|
# uses: act/common/utils/chown@master
|
|
# with:
|
|
# file: ${{ inputs.tmpDir }}
|
|
- name: "Remove temporary files."
|
|
run: rm -rf "${{ inputs.tmpDir }}"
|
|
shell: bash |