diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f738352 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM php:7.1-cli + +LABEL "com.github.actions.name"="GA-PHPLint" +LABEL "com.github.actions.description"="Run PHP linter on PR" +LABEL "com.github.actions.icon"="aperture" +LABEL "com.github.actions.color"="blue" + +LABEL version="0.0.1" +LABEL repository="https://github.com/justia/ga-phplint-7.1" +LABEL homepage="https://github.com/justia/ga-phplint-7.1" + +RUN apt-get update && apt-get -y install zip unzip + +RUN curl -sS https://getcomposer.org/installer | php -- \ +--install-dir=/usr/bin --filename=composer && chmod +x /usr/bin/composer + +RUN mkdir /phplint && cd /phplint && composer require overtrue/phplint && ln -s /phplint/vendor/bin/phplint /usr/local/bin/phplint + +COPY "entrypoint.sh" "/entrypoint.sh" +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..3aec3fe --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# GA-PHPLint7.1 +PHP 7.1 linter. diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..20edcfd --- /dev/null +++ b/action.yml @@ -0,0 +1,9 @@ +# action.yml +name: 'PHPLint' +description: 'Run PHP lint on PR' +outputs: + pass: # if code ok + description: 'Codes passes linter' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..8cc2e38 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +phplint ./