diff --git a/action.yml b/action.yml index 7cf0d6e..80cd492 100644 --- a/action.yml +++ b/action.yml @@ -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 \ No newline at end of file + if [ "$PRINT_ENV_VARS" = "true" ]; then + echo -e "\nPrinting environment variables:" + env | sort + fi + } | tee -a $GITHUB_OUTPUT