Skip to content

Commit 8812fab

Browse files
authored
Update action.yml
1 parent 2ee6239 commit 8812fab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

action.yml

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
description: 'Whether to print environment variables'
66
required: false
77
default: 'false'
8+
add_to_summary:
9+
description: 'Whether to add inputs to GitHub Summary'
10+
required: false
11+
default: 'false'
812
outputs:
913
output:
1014
description: 'The output of the action'
@@ -20,6 +24,7 @@ runs:
2024
shell: bash
2125
env:
2226
PRINT_ENV_VARS: ${{ inputs.print_env_vars }}
27+
ADD_TO_SUMMARY: ${{ inputs.add_to_summary }}
2328
run: |
2429
output=$(
2530
echo "Checking for workflow_dispatch inputs:"
@@ -28,6 +33,11 @@ runs:
2833
inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
2934
if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
3035
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
3141
else
3242
echo "No workflow_dispatch inputs found in the event payload."
3343
fi

0 commit comments

Comments
 (0)