File tree Expand file tree Collapse file tree 4 files changed +52
-1
lines changed Expand file tree Collapse file tree 4 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 1
- FROM composer:1.10.15
1
+ FROM ghcr.io/php-actions/php-build:latest
2
2
3
3
LABEL repository="https://github.com/php-actions/composer"
4
4
LABEL homepage="https://github.com/php-actions/composer"
5
5
LABEL maintainer=
"Greg Bowler <[email protected] >"
6
6
7
+ RUN curl https://getcomposer.org/download/1.10.17/composer.phar > composer-1.phar
8
+ RUN curl https://getcomposer.org/download/2.0.6/composer.phar > composer-2.phar
9
+ RUN chmod +x *.phar
10
+ RUN ln -s $(pwd)/composer-1.phar /usr/local/bin/composer-1
11
+ RUN ln -s $(pwd)/composer-2.phar /usr/local/bin/composer-2
12
+ RUN ln -s /usr/local/bin/composer-2 /usr/local/bin/composer
13
+ COPY switch-composer-version /usr/local/bin/.
14
+
7
15
COPY entrypoint /usr/local/bin/entrypoint
8
16
ENTRYPOINT ["/usr/local/bin/entrypoint" ]
9
17
CMD ["help" ]
Original file line number Diff line number Diff line change 1
1
name : ' Composer (php-actions)'
2
2
description : ' Use the Composer CLI in your Github Actions.'
3
3
inputs :
4
+ php_version :
5
+ description : What version of PHP to use
6
+ default : latest
7
+ required : false
8
+
9
+ composer_version :
10
+ description : What version of Composer to use
11
+ default : latest
12
+ required : false
13
+
4
14
command :
5
15
description : Composer command to run
6
16
required : true
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
4
+ if [ -n " $action_php_version " ]
5
+ then
6
+ echo " Using PHP version: $action_php_version "
7
+ switch-php-version $action_php_version
8
+ fi
9
+
10
+ if [ -n " $action_composer_version " ]
11
+ then
12
+ echo " Using Composer version: $action_composer_version "
13
+ switch-composer-version $action_composer_version
14
+ fi
15
+
4
16
command_string=" composer"
5
17
6
18
if [ -n " $action_ssh_key " ]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ if [ " $1 " = " latest" ]
5
+ then
6
+ version=2
7
+ else
8
+ version=$1
9
+ fi
10
+
11
+ composer_bin=" /usr/local/bin/composer-$version "
12
+
13
+ if test -f $composer_bin
14
+ then
15
+ rm -f /usr/local/bin/composer
16
+ ln -s " $composer_bin " " /usr/local/bin/composer"
17
+ echo " Successfully linked $composer_bin "
18
+ else
19
+ echo " Error linking $composer_bin : version doesn't exit"
20
+ exit 1
21
+ fi
You can’t perform that action at this time.
0 commit comments