blob: 7cee233c4f4ce2f9a3856b3c2c719698caedd77b [file] [log] [blame]
name: Dynamic
description: Dynamically resolves another GitHub action
inputs:
action:
description: Action reference
required: true
with:
description: Action inputs as multi-line YAML string
required: false
default: ""
outputs:
outputs:
description: JSON object of outputs from the action
value: ${{ steps.run.outputs.outputs }}
runs:
using: composite
steps:
- name: Instantiate
shell: bash
run: |
# Dynamically invoke ${{ inputs.action }}
with='${{ inputs.with }}'
[[ -z "$with" ]] || with="$(echo ' with:'; sed -e 's/^/ /' <<<"$with")"
mkdir -p ./.tmp/dynamic-action-instance
cat <<END >./.tmp/dynamic-action-instance/action.yaml
runs:
using: composite
steps:
- id: run
uses: ${{ inputs.action }}
$with
outputs:
outputs:
value: $(echo '$'){{ toJSON(steps.run.outputs) }}
END
- name: Run
id: run
uses: ./.tmp/dynamic-action-instance