Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shayki5 authored Jul 23, 2024
1 parent 2c309ba commit 4650201
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ runs:
PRINT_ENV_VARS: ${{ inputs.print_env_vars }}
run: |
{
echo "Printing all workflow_dispatch inputs:"
if [ -n "$GITHUB_EVENT_PATH" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"'
echo "Checking for workflow_dispatch inputs:"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
if [ -n "$GITHUB_EVENT_PATH" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
inputs=$(jq -r '.inputs // empty' "$GITHUB_EVENT_PATH")
if [ -n "$inputs" ] && [ "$inputs" != "null" ]; then
echo "$inputs" | jq -r 'to_entries[] | "\(.key): \(.value)"'
else
echo "No workflow_dispatch inputs found in the event payload."
fi
else
echo "No workflow_dispatch inputs found in the event payload."
echo "GITHUB_EVENT_PATH is not set or the file does not exist."
fi
else
echo "GITHUB_EVENT_PATH is not set or the file does not exist. This action may not be running in a workflow_dispatch context."
echo "This is not a workflow_dispatch event. No inputs expected."
fi
if [ "$PRINT_ENV_VARS" = "true" ]; then
Expand Down

0 comments on commit 4650201

Please sign in to comment.