Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Any arbitrary arguments can be passed to composer by using the `args` input, how
+ `progress` - Whether to output download progress - yes / no (default no)
+ `quiet` - Whether to suppress all messages - yes / no (default no)
+ `args` - Optional arguments to pass - no constraints (default _empty_)
+ `only_args` - Only run the desired command with this args. Ignoring all other provided arguments(default _empty_)

There are also SSH input available: `ssh_key`, `ssh_key_pub` and `ssh_domain` that are used for depending on private repositories. See below for more information on usage.

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ inputs:
required: true
default: install

only_args:
description: "Only run the desired command with this args. Ignoring all other provided arguments"
required: false

interaction:
description: "Whether to ask any interactive questions. Values: 'yes' or 'no'"
required: false
Expand Down Expand Up @@ -55,6 +59,7 @@ runs:
image: 'Dockerfile'
env:
action_command: ${{ inputs.command }}
action_only_args: ${{ inputs.only_args }}
action_interaction: ${{ inputs.interaction }}
action_suggest: ${{ inputs.suggest }}
action_dev: ${{ inputs.dev }}
Expand Down
132 changes: 69 additions & 63 deletions entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -31,74 +31,80 @@ then
command_string="$command_string $action_command"
fi

case "$action_interaction" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-interaction"
;;
*)
echo "Invalid input for action argument: interaction (must be yes or no)"
exit 1
;;
esac
if [ ! -n "$action_only_args" ]
then

case "$action_suggest" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-suggest"
;;
*)
echo "Invalid input for action argument: suggest (must be yes or no)"
exit 1
;;
esac
case "$action_interaction" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-interaction"
;;
*)
echo "Invalid input for action argument: interaction (must be yes or no)"
exit 1
;;
esac

case "$action_dev" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-dev"
;;
*)
echo "Invalid input for action argument: dev (must be yes or no)"
exit 1
;;
esac
case "$action_suggest" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-suggest"
;;
*)
echo "Invalid input for action argument: suggest (must be yes or no)"
exit 1
;;
esac

case "$action_progress" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-progress"
;;
*)
echo "Invalid input for action argument: progress (must be yes or no)"
exit 1
;;
esac
case "$action_dev" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-dev"
;;
*)
echo "Invalid input for action argument: dev (must be yes or no)"
exit 1
;;
esac

case "$action_quiet" in
yes)
command_string="$command_string --quiet"
;;
no)
# Default behaviour
;;
*)
echo "Invalid input for action argument: quiet (must be yes or no)"
exit 1
;;
esac
case "$action_progress" in
yes)
# Default behaviour
;;
no)
command_string="$command_string --no-progress"
;;
*)
echo "Invalid input for action argument: progress (must be yes or no)"
exit 1
;;
esac

if [ -n "$action_args" ]
then
command_string="$command_string $action_args"
case "$action_quiet" in
yes)
command_string="$command_string --quiet"
;;
no)
# Default behaviour
;;
*)
echo "Invalid input for action argument: quiet (must be yes or no)"
exit 1
;;
esac

if [ -n "$action_args" ]
then
command_string="$command_string $action_args"
fi
else
command_string="$command_string $action_only_args"
fi

echo "Command: $command_string"
Expand Down