Skip to content

Commit

Permalink
refact: replace app_folder to container_workdir
Browse files Browse the repository at this point in the history
  • Loading branch information
vakaman committed Jul 8, 2023
1 parent 280bb02 commit cb274c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Any arbitrary arguments can be passed to composer by using the `args` input, how
+ `php_version` - Choose which version of PHP you want to use - x.y (default `latest`) (e.g. `7.4.29`, 8.2`, or any version listed on https://www.php.net/releases/index.php)
+ `version` - Choose which version of Composer you want to use - default `latest` (e.g. `1.10`, `2.3`, `2.5.4`)
+ `memory_limit` - Sets the composer memory limit - (default _empty_)
+ `app_folder` - Sets the aplication folder - (default /app)
+ `container_workdir` - Sets the aplication workdir inside container - (default /app)

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
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ inputs:
description: "Sets the composer memory limit"
required: false

app_folder:
description: "Sets the aplication folder"
container_workdir:
description: "Sets the aplication workdir inside container"
required: false

outputs:
Expand Down Expand Up @@ -103,7 +103,7 @@ runs:
ACTION_SSH_PORT: ${{ inputs.ssh_port }}
ACTION_WORKING_DIR: ${{ inputs.working_dir }}
ACTION_MEMORY_LIMIT: ${{ inputs.memory_limit }}
ACTION_APP_FOLDER: ${{ inputs.app_folder }}
ACTION_CONTAINER_WORKDIR: ${{ inputs.container_workdir }}
id: composer_run
run: |
set -e
Expand Down
8 changes: 4 additions & 4 deletions composer-action.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

app_folder="/app"
container_workdir="/app"
github_action_path=$(dirname "$0")
docker_tag=$(cat ./docker_tag)
echo "Docker tag: $docker_tag" >> output.log 2>&1
Expand Down Expand Up @@ -196,8 +196,8 @@ do
fi
done <<<$(env)

if [ -z "$ACTION_APP_FOLDER" ]; then
app_folder="${ACTION_APP_FOLDER}"
if [ -z "$ACTION_CONTAINER_WORKDIR" ]; then
container_workdir="${ACTION_CONTAINER_WORKDIR}"
fi

echo "name=full_command::${command_string}" >> $GITHUB_OUTPUT
Expand All @@ -208,7 +208,7 @@ docker run --rm \
--volume ~/.ssh:/root/.ssh \
--volume "${GITHUB_WORKSPACE}":/app \
--volume "/tmp/composer-cache":/tmp/composer-cache \
--workdir ${app_folder} \
--workdir ${container_workdir} \
--env-file ./DOCKER_ENV \
--network host \
${memory_limit} \
Expand Down

0 comments on commit cb274c5

Please sign in to comment.