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
22
33LABEL repository="https://github.com/php-actions/composer"
44LABEL homepage="https://github.com/php-actions/composer"
55LABEL maintainer=
"Greg Bowler <[email protected] >" 66
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+
715COPY entrypoint /usr/local/bin/entrypoint
816ENTRYPOINT ["/usr/local/bin/entrypoint" ]
917CMD ["help" ]
Original file line number Diff line number Diff line change 11name : ' Composer (php-actions)'
22description : ' Use the Composer CLI in your Github Actions.'
33inputs :
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+
414 command :
515 description : Composer command to run
616 required : true
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
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+
416command_string=" composer"
517
618if [ -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