diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d22c987..e736489 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,8 +17,11 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Clean up + run: rm -rf ./codestyle + - name: Check the container - uses: TheDragonCode/codestyler@main + uses: TheDragonCode/codestyler@3.x unit: runs-on: ${{ matrix.os }} diff --git a/Dockerfile b/Dockerfile index 409679b..1fff3a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG PHP_VERSION=stable +FROM helldar/laravel-gitlab-ci:stable -FROM helldar/laravel-gitlab-ci:${PHP_VERSION} +LABEL maintainer="Andrey Helldar" ARG INPUT_FIX ARG INPUT_GITHUB_TOKEN @@ -8,6 +8,8 @@ ARG INPUT_EDITORCONFIG ARG INPUT_DEPENDABOT ARG INPUT_NORMALIZE +RUN composer global require dragon-code/codestyler:^3.3 + COPY shell /shell COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/action.yml b/action.yml index 07e7445..fb8bc73 100644 --- a/action.yml +++ b/action.yml @@ -11,15 +11,15 @@ inputs: required: false default: 'false' editorconfig: - description: 'Update `.editorconfig` file.' + description: 'Update .editorconfig file.' required: false default: 'true' dependabot: - description: 'Updating Dependabot rules.' + description: 'Update Dependabot rules.' required: false default: 'true' normalize: - description: 'Normalizing composer.json.' + description: 'Normalize the composer.json file.' required: false default: 'true' runs: diff --git a/entrypoint.sh b/entrypoint.sh index cfed3d3..e061e9e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/sh -l +export PATH="$HOME/.composer/vendor/bin:~/.composer/vendor/bin:./vendor/bin:/vendor/bin:/composer/vendor/bin:$HOME/.composer/vendor/bin:/var/www/vendor/bin:$HOME/.local/composer/vendor/bin:$COMPOSER_HOME/vendor/bin:$PATH" + source /shell/functions.sh source /shell/config.sh source /shell/plugins.sh diff --git a/shell/check.sh b/shell/check.sh index 2097562..f3a198f 100644 --- a/shell/check.sh +++ b/shell/check.sh @@ -1,7 +1,6 @@ #!/bin/sh -l if [[ $(allowFix) == "false" ]]; then - echo "Check the code style..." codestyle --test exitcode=$? diff --git a/shell/dependabot.sh b/shell/dependabot.sh index 689718c..2b1b82e 100644 --- a/shell/dependabot.sh +++ b/shell/dependabot.sh @@ -5,6 +5,5 @@ IS_DIRTY_DEPENDABOT=0 if [[ $(allow "$INPUT_DEPENDABOT") == "true" ]]; then IS_DIRTY_DEPENDABOT=1 - echo "Update Dependabot rules..." - { codestyle dependabot && git add .github/dependabot.yml && git commit -a -m "๐Ÿ”„๏ธ Updated Dependabot rules"; } || IS_DIRTY_DEPENDABOT=0 + { codestyle dependabot && git add .github/dependabot.yml && git commit -a -m "๐Ÿ”„๏ธ Update Dependabot rules"; } || IS_DIRTY_DEPENDABOT=0 fi diff --git a/shell/editorconfig.sh b/shell/editorconfig.sh index e914c1b..04af1fe 100644 --- a/shell/editorconfig.sh +++ b/shell/editorconfig.sh @@ -5,6 +5,5 @@ IS_DIRTY_EDITORCONFIG=0 if [[ $(allow "$INPUT_EDITORCONFIG") == "true" ]]; then IS_DIRTY_EDITORCONFIG=1 - echo "Export the .editorconfig file..." - { codestyle editorconfig && git add .editorconfig && git commit -a -m "๐Ÿ“– Update .editorconfig"; } || IS_DIRTY_EDITORCONFIG=0 + { codestyle editorconfig && git add .editorconfig && git commit -a -m "๐Ÿ“– Update .editorconfig file"; } || IS_DIRTY_EDITORCONFIG=0 fi diff --git a/shell/fix.sh b/shell/fix.sh index a3383fa..3f5b359 100644 --- a/shell/fix.sh +++ b/shell/fix.sh @@ -2,8 +2,6 @@ IS_DIRTY_CODE=1 -echo "Fix the code style..." - codestyle -{ git add . && git commit -a -m "๐Ÿงน Fixed style code"; } || IS_DIRTY_CODE=0 +{ git add . && git commit -a -m "๐Ÿงน Fix style code"; } || IS_DIRTY_CODE=0 diff --git a/shell/normalize.sh b/shell/normalize.sh index 760dfd6..303b9d5 100644 --- a/shell/normalize.sh +++ b/shell/normalize.sh @@ -7,8 +7,6 @@ if [[ $(allow "$INPUT_NORMALIZE") == "true" ]]; then if [[ -f "./composer.json" ]]; then IS_DIRTY_NORMALIZE=1 - echo "Normalize the composer.json file..." - { composer normalize && git add composer.json composer.lock && git commit -a -m "๐Ÿฆ‹ Normalized composer.json"; } || IS_DIRTY_NORMALIZE=0 fi fi