File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 5
5
description : ' Whether to print environment variables'
6
6
required : false
7
7
default : ' false'
8
+ add_to_summary :
9
+ description : ' Whether to add inputs to GitHub Summary'
10
+ required : false
11
+ default : ' false'
8
12
outputs :
9
13
output :
10
14
description : ' The output of the action'
20
24
shell : bash
21
25
env :
22
26
PRINT_ENV_VARS : ${{ inputs.print_env_vars }}
27
+ ADD_TO_SUMMARY : ${{ inputs.add_to_summary }}
23
28
run : |
24
29
output=$(
25
30
echo "Checking for workflow_dispatch inputs:"
28
33
inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
29
34
if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
30
35
echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"'
36
+ if [ "$ADD_TO_SUMMARY" = "true" ]; then
37
+ echo -e "\n<details>\n<summary>Workflow Dispatch Inputs</summary>\n\n\`\`\`" >> $GITHUB_STEP_SUMMARY
38
+ echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"' >> $GITHUB_STEP_SUMMARY
39
+ echo -e "\n\`\`\`\n</details>" >> $GITHUB_STEP_SUMMARY
40
+ fi
31
41
else
32
42
echo "No workflow_dispatch inputs found in the event payload."
33
43
fi
You can’t perform that action at this time.
0 commit comments