@@ -5,30 +5,35 @@ inputs:
5
5
description : ' Whether to print environment variables'
6
6
required : false
7
7
default : ' false'
8
+ outputs :
9
+ output :
10
+ description : ' The output of the action'
8
11
branding :
9
12
icon : ' printer'
10
13
color : ' blue'
11
14
runs :
12
15
using : " composite"
13
16
steps :
14
- - name : Print inputs & env vars
17
+ - name : Print workflow_dispatch inputs and env vars
15
18
shell : bash
16
19
env :
17
20
PRINT_ENV_VARS : ${{ inputs.print_env_vars }}
18
21
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
24
31
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 ."
26
33
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
30
34
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