Can't access to input variables on 'workflow_dispatch' event
I have this action:
name: Simple Task
on:
workflow_dispatch:
inputs:
delay_seconds:
description: 'Time to delay'
required: false
default: 60
jobs:
simple-task:
runs-on: ubuntu-latest
steps:
- name: delay execution
env:
input_delay: ${{ github.event.inputs.delay_seconds }}
run: sleep $input_delay
- name: Run a one-line script
run: echo 'done'
When executing act workflow_dispatch -j simple-task I get the following error:
ERRO[0000] Unable to interpolate string '${{ github.event.inputs.delay_seconds }}' - [TypeError: Cannot access member 'delay_seconds' of undefined]
The workflow works fine on github.
Looks like same as https://github.com/nektos/act/issues/295
Issue is stale and will be closed in 14 days unless there is new activity
Any workaround for this?
I've tried adding a JSON payload like this
{
"workflow_dispatch": {
"inputs": {
"IMAGE_TAG": "dev-1"
}
}
}
It doesn't work
Ahhh got it working with simply
{
"inputs": {
"IMAGE_TAG": "latest"
}
}
The docs/README are a little unclear on how to format the JSON, it's implied from the provided example, that the top level keys are the event types, but this isnt the case
@benc-uk Thanks for your comment and I agree with you. This should be either fixed to work like other events or this exception should be clearly stated in README because this behaviour wasn't inferable for me by reading https://github.com/nektos/act#events