From b8f7b4deffc6f423beacd908e3c84337465e17a1 Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Sun, 28 Apr 2024 18:19:20 -0500 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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: