Unfortunately, this is not possible yet. As I wrote in a previous answer, the only supported input types for actions are string | number | boolean (schema: with ref: definitions/env).
So the workaround would be either you pass multiple arguments to your action, or you pass them as a JSON string then you parse it with jq (if your action uses shell/bash).
And here are these example workarounds:
Specify more options as inputs to your action
Simply add more inputs to your action instead of one input of type map:
name: 'Hello World'
description: 'Greet someone'
inputs:
greeting-word:
description: What to say
required: false
default: Hello
who-to-greet:
description: 'Who to greet'
required: true
something-else:
description: Something else to say
required: false
default: ""
runs:
using: "composite"
steps:
- name: Greet!
shell: bash
run: echo "${{ inputs.greeting-word }} ${{ inputs.who-to-greet }} ${{ inputs.something-else }}"
Then just pass them form your workflow file
- name: Greet
uses: ./.github/actions/my-action
with:
greeting-word: Hallo
who-to-greet: Bob
Pass arguments as a JSON string
Workflow file:
- name: Greet
uses: ./.github/actions/my-action
with:
greeting-args: '{"greeting-word": "Hello", "who-to-greet": "Bob"}'
The action
name: 'Hello World'
description: 'Greet someone'
inputs:
greeting-args:
required: true
description: Greeting arguments
runs:
using: "composite"
steps:
- name: Greet!
shell: bash
run: |
MY_INPUT='${{ inputs.greeting-args }}'
GREETING_WORD=$(echo $MY_INPUT | jq -r '."greeting-word"')
WHO_TO_GREET=$(echo $MY_INPUT | jq -r '."who-to-greet"')
echo "${GREETING_WORD} ${WHO_TO_GREET}"
Or you can pass it as a multi-line string
This approach is used by actions like actions/upload-artifact
- uses: actions/upload-artifact@v3
with:
name: my-artifact
path: |
path/output/bin/
path/output/test-results
!path/**/*.tmp
And google-github-actions/get-secretmanager-secrets
- id: 'secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v1'
with:
secrets: |-
token:my-project/docker-registry-token
anotherOne:my-project/a-secret
anotherOneToo:my-project/another-secret
i.e you just need to read these lines and split your map's key/values