Skip to content

Commit 44e6439

Browse files
authored
Update action.yml
1 parent c664cb3 commit 44e6439

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

action.yml

+19-14
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,35 @@ inputs:
55
description: 'Whether to print environment variables'
66
required: false
77
default: 'false'
8+
outputs:
9+
output:
10+
description: 'The output of the action'
811
branding:
912
icon: 'printer'
1013
color: 'blue'
1114
runs:
1215
using: "composite"
1316
steps:
14-
- name: Print inputs & env vars
17+
- name: Print workflow_dispatch inputs and env vars
1518
shell: bash
1619
env:
1720
PRINT_ENV_VARS: ${{ inputs.print_env_vars }}
1821
run: |
19-
echo "Printing all workflow_dispatch inputs:"
20-
if [ -n "$GITHUB_EVENT_PATH" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
21-
inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
22-
if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
23-
echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"'
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)"'
28+
else
29+
echo "No workflow_dispatch inputs found in the event payload."
30+
fi
2431
else
25-
echo "No workflow_dispatch inputs found in the event payload."
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."
2633
fi
27-
else
28-
echo "GITHUB_EVENT_PATH is not set or the file does not exist. This action may not be running in a workflow_dispatch context."
29-
fi
3034
31-
if [ "$PRINT_ENV_VARS" = "true" ]; then
32-
echo -e "\nPrinting environment variables:"
33-
env | sort
34-
fi
35+
if [ "$PRINT_ENV_VARS" = "true" ]; then
36+
echo -e "\nPrinting environment variables:"
37+
env | sort
38+
fi
39+
} | tee -a $GITHUB_OUTPUT

0 commit comments

Comments
 (0)