From bbf0c83895e4649ef743b7c301fd11bb5b9f5020 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Sat, 5 Feb 2022 21:34:36 +0000 Subject: [PATCH 01/18] quote strings --- action.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index 67a1b17..4ea3471 100644 --- a/action.yml +++ b/action.yml @@ -1,23 +1,23 @@ -name: Composer (php-actions) -description: Use the Composer CLI in your Github Actions. +name: "Composer (php-actions)" +description: "Use the Composer CLI in your Github Actions." inputs: version: - description: What version of Composer to use + description: "What version of Composer to use" default: latest required: false php_version: - description: What version of PHP to use + description: "What version of PHP to use" default: latest required: false php_extensions: - description: Space separated list of extensions to configure with the PHP build + description: "Space separated list of extensions to configure with the PHP build" required: false command: - description: Composer command to run + description: "Composer command to run" required: true default: install @@ -46,27 +46,27 @@ inputs: default: no args: - description: Optional arguments to pass + description: "Optional arguments to pass" required: false ssh_key: - description: The private key contents to use for private repositories + description: "The private key contents to use for private repositories" required: false ssh_key_pub: - description: The public key contents to use for private repositories + description: "The public key contents to use for private repositories" required: false ssh_domain: - description: The domain to gather SSH public keys for (automatic for github.com, gitlab.com, bitbucket.org) + description: "The domain to gather SSH public keys for (automatic for github.com, gitlab.com, bitbucket.org)" required: false working_dir: - description: Use the given directory as working directory + description: "Use the given directory as working directory" required: false memory_limit: - description: Sets the composer memory limit + description: "Sets the composer memory limit" required: false outputs: From f1ef0c3fe1beaeac067ef380e3e08d8ced64235c Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 9 Nov 2022 16:01:26 +0000 Subject: [PATCH 02/18] docs: update version numbers --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6a89b2c..715c973 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: php-actions/composer@v6 # ... then your own project steps ... ``` @@ -152,10 +152,10 @@ jobs: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache Composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: /tmp/composer-cache key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} From b44ff701cc4b0bb7652e8085978fc65437887336 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 10 Nov 2022 11:40:00 +0000 Subject: [PATCH 03/18] feature: simplify error output --- action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 39af3a6..3d5fa92 100644 --- a/action.yml +++ b/action.yml @@ -100,8 +100,10 @@ runs: ACTION_WORKING_DIR: ${{ inputs.working_dir }} ACTION_MEMORY_LIMIT: ${{ inputs.memory_limit }} id: composer_run - run: bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ - && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; } + run: | + set -e + bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) composer + ${{ github.action_path }}/composer-action.bash || cat ${{ github.workspace }}/output.log shell: bash branding: From 58260d1d3c7c1576becac3ac182175adf510e953 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Fri, 11 Nov 2022 10:39:30 +0000 Subject: [PATCH 04/18] feature: return non-zero exit code on failure --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3d5fa92..4e604e6 100644 --- a/action.yml +++ b/action.yml @@ -103,7 +103,7 @@ runs: run: | set -e bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) composer - ${{ github.action_path }}/composer-action.bash || cat ${{ github.workspace }}/output.log + ${{ github.action_path }}/composer-action.bash shell: bash branding: From da5a2cb77d99e639acfee65b60a70332793fcd6f Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 5 Jan 2023 16:49:34 +0000 Subject: [PATCH 05/18] build: upgrade to v2.2.0 of php-build closes #62 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4e604e6..ee3609d 100644 --- a/action.yml +++ b/action.yml @@ -102,7 +102,7 @@ runs: id: composer_run run: | set -e - bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) composer + bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/v2.2.0/php-build.bash) composer ${{ github.action_path }}/composer-action.bash shell: bash From e33c201900ba0f6b7e54c9a29e4f308ea29caa65 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 27 Apr 2023 09:11:21 +0100 Subject: [PATCH 06/18] docs: clarify versioning closes #101 --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 715c973..771bf96 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Please feel free to use `uses: php-actions/composer@v6` to always run the latest Running custom commands ----------------------- -By default, adding `- uses: php-actions/composer@v6` into your workflow will run `composer install`, as `install` is the default command name. The install command will be provided with a default set of arguments (see below). +By default, adding `- uses: php-actions/composer@v6` into your workflow will run `composer install`, as `install` is the default command name. The `install` command will be provided with a default set of arguments (see below). You can issue custom commands by passing a `command` input, like so: @@ -60,14 +60,14 @@ Passing arguments Any arbitrary arguments can be passed to composer by using the `args` input, however there are a few inputs pre-configured to handle common arguments. All inputs are optional. Please see the following list: -+ `interaction` - Whether to ask any interactive questions - yes / no (default no) -+ `dev` - Whether to install dev packages - yes / no (default **yes**) -+ `progress` - Whether to output download progress - yes / no (default no) -+ `quiet` - Whether to suppress all messages - yes / no (default no) ++ `interaction` - Whether to ask any interactive questions - yes / no (default `no`) ++ `dev` - Whether to install dev packages - yes / no (default `yes`) ++ `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_) -+ `php_version` - Choose which version of PHP you want to use (7.1, 7.2, 7.3, 7.4 or 8.0) -+ `version` - Choose which version of Composer you want to use (1.x, 2.x, 2.2.x, latest) ++ `php_version` - Choose which version of PHP you want to use - x.y (default `latest`) (e.g. `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_) 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. From 9357db0fb3020086db5a9922354c8dc643927bcd Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 27 Apr 2023 09:12:35 +0100 Subject: [PATCH 07/18] docs: clarify versioning --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 771bf96..eed2551 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Any arbitrary arguments can be passed to composer by using the `args` input, how + `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_) -+ `php_version` - Choose which version of PHP you want to use - x.y (default `latest`) (e.g. `8.2`, or any version listed on https://www.php.net/releases/index.php) ++ `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_) From d9d07aae8e5e00e0f4787bca8ae4fd9126dad4a5 Mon Sep 17 00:00:00 2001 From: Maicol Kaiser Date: Fri, 7 Jul 2023 16:25:48 -0300 Subject: [PATCH 08/18] feat: add app folder --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index ee3609d..639f3ac 100644 --- a/action.yml +++ b/action.yml @@ -73,6 +73,10 @@ inputs: description: "Sets the composer memory limit" required: false + app_folder: + description: "Sets the aplication folder" + required: false + outputs: full_command: description: "The full command passed to docker to run" @@ -99,6 +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 }} id: composer_run run: | set -e From 1d8a288abe689a7d136c6b811d33d7e548c6dff1 Mon Sep 17 00:00:00 2001 From: Maicol Kaiser Date: Fri, 7 Jul 2023 16:26:04 -0300 Subject: [PATCH 09/18] feat: add app folder when env exists --- composer-action.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composer-action.bash b/composer-action.bash index fdb1a93..77f53b2 100755 --- a/composer-action.bash +++ b/composer-action.bash @@ -1,5 +1,7 @@ #!/bin/bash set -e + +app_folder="/app" github_action_path=$(dirname "$0") docker_tag=$(cat ./docker_tag) echo "Docker tag: $docker_tag" >> output.log 2>&1 @@ -194,6 +196,10 @@ do fi done <<<$(env) +if [ -z "$ACTION_APP_FOLDER" ]; then + app_folder="${ACTION_APP_FOLDER}" +fi + echo "name=full_command::${command_string}" >> $GITHUB_OUTPUT docker run --rm \ @@ -202,7 +208,7 @@ docker run --rm \ --volume ~/.ssh:/root/.ssh \ --volume "${GITHUB_WORKSPACE}":/app \ --volume "/tmp/composer-cache":/tmp/composer-cache \ - --workdir /app \ + --workdir ${app_folder} \ --env-file ./DOCKER_ENV \ --network host \ ${memory_limit} \ From 280bb0248446e9d52000a3b9977084d1d37ba3ae Mon Sep 17 00:00:00 2001 From: Maicol Kaiser Date: Fri, 7 Jul 2023 16:26:20 -0300 Subject: [PATCH 10/18] feat: update readme to include example of app_folder --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index eed2551..8311fc6 100644 --- a/README.md +++ b/README.md @@ -69,6 +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) 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. From cb274c54eb15b0f18260025d600f27377a8e3339 Mon Sep 17 00:00:00 2001 From: Maicol Kaiser Date: Sat, 8 Jul 2023 09:18:22 -0300 Subject: [PATCH 11/18] refact: replace app_folder to container_workdir --- README.md | 2 +- action.yml | 6 +++--- composer-action.bash | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8311fc6..520c66a 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/action.yml b/action.yml index 639f3ac..a4b8332 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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 diff --git a/composer-action.bash b/composer-action.bash index 77f53b2..1ccbef7 100755 --- a/composer-action.bash +++ b/composer-action.bash @@ -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 @@ -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 @@ -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} \ From 1d79c12e8d454cf970f5815c42b0464a493b634f Mon Sep 17 00:00:00 2001 From: Maicol Kaiser Date: Sat, 8 Jul 2023 09:23:22 -0300 Subject: [PATCH 12/18] feat: add reference to execute installation in a different folder --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 520c66a..649a316 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,20 @@ jobs: version: 1 ``` +Execute composer install in a different folder +------------------------------------------- + +```yaml + - name: Install dependencies + uses: "php-actions/composer@v6" + env: + COMPOSER: "composer.json" + with: + php_version: "5.6.40" + version: "2.2" + args: "--ignore-platform-reqs --optimize-autoloader" + working_dir: "my/different/folder" +``` Including PHP Extensions ------------------------------------------- From 7cb7a3f76d7fde2cff3c5d809ebd85d8aec6f1af Mon Sep 17 00:00:00 2001 From: Marc <980978+MarcHagen@users.noreply.github.com> Date: Thu, 31 Aug 2023 23:53:06 +0200 Subject: [PATCH 13/18] docs: clarify versioning Update text about `version` stating `2.3` would be a valid option, rephrasing it too `2.x`, `2.2.x`, or any exact version number listed on getcomposer.org --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eed2551..b217b61 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Any arbitrary arguments can be passed to composer by using the `args` input, how + `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_) + `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`) ++ `version` - Choose which version of Composer you want to use - default `latest` (e.g. `1.x`, `1.10.26`, `2.x`, `2.2.x`, or any exact version listed on https://getcomposer.org/download/) + `memory_limit` - Sets the composer memory limit - (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. @@ -95,7 +95,7 @@ This action runs on a custom base image, available at https://github.com/php-act Use the following inputs to run a specific PHP/Composer version combination: + `php_version` Available versions: `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1` (default: `latest` aka: `8.1`) -+ `version` Available versions: `latest`, `preview`, `snapshot`, `1.x`, `2.x`, `2.2.x` or the exact version (default: `latest`) ++ `version` Available versions: `latest`, `preview`, `snapshot`, `1.x`, `2.x`, `2.2.x` or an exact version like `2.5.8` (default: `latest`) Make sure to put the PHP version number in quotes, otherwise YAML will interpret e.g. `8.0` as `8` which means latest 8.x, not 8.0. From a5c4836925dc53c8da6d7b31e1b81a3a79d046a7 Mon Sep 17 00:00:00 2001 From: Jamie Balish Date: Fri, 8 Sep 2023 11:46:40 +0100 Subject: [PATCH 14/18] fix: use ACTION_CONTAINER_WORKDIR if not empty --- composer-action.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer-action.bash b/composer-action.bash index 1ccbef7..b61a22f 100755 --- a/composer-action.bash +++ b/composer-action.bash @@ -196,7 +196,7 @@ do fi done <<<$(env) -if [ -z "$ACTION_CONTAINER_WORKDIR" ]; then +if [ -n "$ACTION_CONTAINER_WORKDIR" ]; then container_workdir="${ACTION_CONTAINER_WORKDIR}" fi From b8f7b4deffc6f423beacd908e3c84337465e17a1 Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Sun, 28 Apr 2024 18:19:20 -0500 Subject: [PATCH 15/18] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a4b8332..a3999ab 100644 --- a/action.yml +++ b/action.yml @@ -107,7 +107,7 @@ runs: id: composer_run run: | set -e - bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/v2.2.0/php-build.bash) composer + bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/v2/php-build.bash) composer ${{ github.action_path }}/composer-action.bash shell: bash From e4d1efe5c0ee92d71eb91272ad90430453475424 Mon Sep 17 00:00:00 2001 From: "Phil E. Taylor" Date: Thu, 21 Nov 2024 17:44:24 +0000 Subject: [PATCH 16/18] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41e3446..58df3d5 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Any arbitrary arguments can be passed to composer by using the `args` input, how + `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_) -+ `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) ++ `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.x`, `1.10.26`, `2.x`, `2.2.x`, or any exact version listed on https://getcomposer.org/download/) + `memory_limit` - Sets the composer memory limit - (default _empty_) + `container_workdir` - Sets the aplication workdir inside container - (default /app) From a26c28db3fea8c0bf0ab48b66fcb18d176e0a059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=B6pcke?= Date: Fri, 27 Dec 2024 07:01:42 +0100 Subject: [PATCH 17/18] fix ssh key on self hosted runners --- composer-action.bash | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/composer-action.bash b/composer-action.bash index b61a22f..23f6e2d 100755 --- a/composer-action.bash +++ b/composer-action.bash @@ -52,37 +52,39 @@ command_string="composer" # In case there is need to install private repositories, SSH details are stored # in these two places, which are mounted on the Composer docker container later. -mkdir -p ~/.ssh -touch ~/.gitconfig +ssh_path="${github_action_path}/__tmp/ssh" +gitconfig_path="${github_action_path}/__tmp/gitconfig" +mkdir -p "$ssh_path" +touch "$gitconfig_path" if [ -n "$ACTION_SSH_KEY" ] then echo "Storing private key file for root" >> output.log 2>&1 - ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts - ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts - ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts + ssh-keyscan -t rsa github.com >> "$ssh_path/known_hosts" + ssh-keyscan -t rsa gitlab.com >> "$ssh_path/known_hosts" + ssh-keyscan -t rsa bitbucket.org >> "$ssh_path/known_hosts" if [ -n "$ACTION_SSH_DOMAIN" ] then if [ -n "$ACTION_SSH_PORT" ] then - ssh-keyscan -t rsa -p $ACTION_SSH_PORT "$ACTION_SSH_DOMAIN" >> ~/.ssh/known_hosts + ssh-keyscan -t rsa -p $ACTION_SSH_PORT "$ACTION_SSH_DOMAIN" >> "$ssh_path/known_hosts" else - ssh-keyscan -t rsa "$ACTION_SSH_DOMAIN" >> ~/.ssh/known_hosts + ssh-keyscan -t rsa "$ACTION_SSH_DOMAIN" >> "$ssh_path/known_hosts" fi fi - echo "$ACTION_SSH_KEY" > ~/.ssh/action_rsa - echo "$ACTION_SSH_KEY_PUB" > ~/.ssh/action_rsa.pub - chmod 600 ~/.ssh/action_rsa + echo "$ACTION_SSH_KEY" > "$ssh_path/action_rsa" + echo "$ACTION_SSH_KEY_PUB" > "$ssh_path/action_rsa.pub" + chmod 600 "$ssh_path/action_rsa" echo "PRIVATE KEY:" >> output.log 2>&1 - md5sum ~/.ssh/action_rsa >> output.log 2>&1 + md5sum "$ssh_path/action_rsa" >> output.log 2>&1 echo "PUBLIC KEY:" >> output.log 2>&1 - md5sum ~/.ssh/action_rsa.pub >> output.log 2>&1 + md5sum "$ssh_path/action_rsa.pub" >> output.log 2>&1 - echo "[core]" >> ~/.gitconfig - echo "sshCommand = \"ssh -i ~/.ssh/action_rsa\"" >> ~/.gitconfig + echo "[core]" >> "$gitconfig_path" + echo "sshCommand = \"ssh -i ~/.ssh/action_rsa\"" >> "$gitconfig_path" else echo "No private keys supplied" >> output.log 2>&1 fi @@ -204,8 +206,8 @@ echo "name=full_command::${command_string}" >> $GITHUB_OUTPUT docker run --rm \ --volume "${github_action_path}/composer.phar":/usr/local/bin/composer \ - --volume ~/.gitconfig:/root/.gitconfig \ - --volume ~/.ssh:/root/.ssh \ + --volume "$gitconfig_path":/root/.gitconfig \ + --volume "$ssh_path":/root/.ssh \ --volume "${GITHUB_WORKSPACE}":/app \ --volume "/tmp/composer-cache":/tmp/composer-cache \ --workdir ${container_workdir} \ @@ -213,3 +215,6 @@ docker run --rm \ --network host \ ${memory_limit} \ ${docker_tag} ${command_string} + +rm -rf "${github_action_path}/__tmp" + From 24fc37399839dfbbc2fb8e0c9a90f0237f06ccfb Mon Sep 17 00:00:00 2001 From: jensen-larkin <70579519+jensen-larkin@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:31:21 +0000 Subject: [PATCH 18/18] Spellcheck / Grammar --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a3999ab..d6e6049 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: "Composer (php-actions)" -description: "Use the Composer CLI in your Github Actions." +description: "Use the Composer CLI in your GitHub Actions." inputs: version: @@ -74,7 +74,7 @@ inputs: required: false container_workdir: - description: "Sets the aplication workdir inside container" + description: "Sets the application workdir inside container" required: false outputs: