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 c664cb3 commit 44e6439
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,35 @@ inputs:
description: 'Whether to print environment variables'
required: false
default: 'false'
outputs:
output:
description: 'The output of the action'
branding:
icon: 'printer'
color: 'blue'
runs:
using: "composite"
steps:
- name: Print inputs & env vars
- name: Print workflow_dispatch inputs and env vars
shell: bash
env:
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 "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)"'
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. This action may not be running in a workflow_dispatch context."
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."
fi
if [ "$PRINT_ENV_VARS" = "true" ]; then
echo -e "\nPrinting environment variables:"
env | sort
fi
if [ "$PRINT_ENV_VARS" = "true" ]; then
echo -e "\nPrinting environment variables:"
env | sort
fi
} | tee -a $GITHUB_OUTPUT

0 comments on commit 44e6439

Please sign in to comment.