Files
common/yq/yq-trim/action.yaml
2025-06-24 15:24:16 -07:00

45 lines
1.2 KiB
YAML

name: yq-trim
description: "Change the language format of a file."
inputs:
input:
description: "Left-hand side of merge."
required: true
recursive:
description: "Recursivevly trim the input. Default: true"
required: true
default: "true"
tmpDir:
description: "Temporary directory. Default: _tmp"
required: true
default: _tmp
outputs:
result:
description: "The converted file."
value: ${{ steps.trim.outputs.console }}
runs:
using: "composite"
steps:
- name: "Make temporary file of input."
id: input
uses: act/common/utils/mktemp@master
with:
input: ${{ inputs.input }}
tmpDir: ${{ inputs.tmpDir }}
- name: "Make temporary file of script."
id: script
uses: act/common/utils/mktemp@master
with:
input: ${{ github.action_path }}/trim.sh
tmpDir: .
- name: "Run script."
id: trim
uses: act/common/yq/yq@master
with:
program: bash
command: ${{ steps.script.outputs.tmp }} ${{ steps.input.outputs.tmp }} ${{ inputs.recursive }}
- name: "Remove temporary files."
run: |
rm "${{ steps.script.outputs.tmp }}"
rm -rf "${{ inputs.tmpDir }}"
shell: bash