Skip to content

Commit 07d9028

Browse files
author
Greg Bowler
authored
Merge pull request #77 from gsdevme/feat_support_specific_version_pinning
feat: support specific composer version pinning
2 parents ac8b2c0 + eb9d279 commit 07d9028

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Any arbitrary arguments can be passed to composer by using the `args` input, how
6767
+ `args` - Optional arguments to pass - no constraints (default _empty_)
6868
+ `only_args` - Only run the desired command with this args. Ignoring all other provided arguments(default _empty_)
6969
+ `php_version` - Choose which version of PHP you want to use (7.1, 7.2, 7.3, 7.4 or 8.0)
70-
+ `version` - Choose which version of Composer you want to use (1 or 2)
70+
+ `version` - Choose which version of Composer you want to use (1.x, 2.x, 2.2.x, latest)
7171
+ `memory_limit` - Sets the composer memory limit - (default _empty_)
7272

7373
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.
@@ -81,7 +81,7 @@ jobs:
8181
...
8282
8383
- name: Install dependencies
84-
uses: php-actions/composer@v6
84+
uses: php-actions/composer@v7
8585
with:
8686
dev: no
8787
args: --profile --ignore-platform-reqs
@@ -94,8 +94,8 @@ This action runs on a custom base image, available at https://github.com/php-act
9494

9595
Use the following inputs to run a specific PHP/Composer version combination:
9696

97-
+ `php_version` Available versions: `7.1`, `7.2`, `7.3`, `7.4`, `8.0` (default: `latest` aka: `8.0`)
98-
+ `version` Available versions: `1`, `2` (default: `latest` aka: `2`)
97+
+ `php_version` Available versions: `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1` (default: `latest` aka: `8.1`)
98+
+ `version` Available versions: `1.x`, `2.x`, `2.2.x` (default: `latest` aka: `2.x`)
9999

100100
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.
101101

@@ -132,7 +132,7 @@ jobs:
132132
with:
133133
php_version: "7.4"
134134
php_extensions: redis exif
135-
version: 2
135+
version: 2.x
136136
```
137137

138138
Caching dependencies for faster builds

composer-action.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ github_action_path=$(dirname "$0")
44
docker_tag=$(cat ./docker_tag)
55
echo "Docker tag: $docker_tag" >> output.log 2>&1
66

7-
phar_url="https://getcomposer.org"
7+
phar_url="https://getcomposer.org/download/latest-"
88
if [ "$ACTION_VERSION" == "latest" ]
99
then
10-
phar_url="${phar_url}/composer-stable.phar"
10+
phar_url="${phar_url}stable/composer.phar"
1111
else
12-
phar_url="${phar_url}/composer-${ACTION_VERSION}.phar"
12+
phar_url="${phar_url}${ACTION_VERSION}/composer.phar"
1313
fi
1414
curl --silent -H "User-agent: cURL (https://github.com/php-actions)" -L "$phar_url" > "${github_action_path}/composer.phar"
1515
chmod +x "${github_action_path}/composer.phar"

0 commit comments

Comments
 (0)