File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,20 @@ runs:
20
20
PRINT_ENV_VARS : ${{ inputs.print_env_vars }}
21
21
run : |
22
22
{
23
- echo "Printing all workflow_dispatch inputs:"
24
- if [ -n "$GITHUB_EVENT_PATH" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
25
- inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
26
- if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
27
- echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"'
23
+ echo "Checking for workflow_dispatch inputs:"
24
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
25
+ if [ -n "$GITHUB_EVENT_PATH" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
26
+ inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
27
+ if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
28
+ echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"'
29
+ else
30
+ echo "No workflow_dispatch inputs found in the event payload."
31
+ fi
28
32
else
29
- echo "No workflow_dispatch inputs found in the event payload ."
33
+ echo "GITHUB_EVENT_PATH is not set or the file does not exist ."
30
34
fi
31
35
else
32
- echo "GITHUB_EVENT_PATH is not set or the file does not exist. This action may not be running in a workflow_dispatch context ."
36
+ echo "This is not a workflow_dispatch event. No inputs expected ."
33
37
fi
34
38
35
39
if [ "$PRINT_ENV_VARS" = "true" ]; then
You can’t perform that action at this time.
0 commit comments