Skip to content

Commit

Permalink
Merge pull request #137 from TheDragonCode/3.x
Browse files Browse the repository at this point in the history
Container bug fixed: `codestyle` not found
  • Loading branch information
andrey-helldar authored Jun 10, 2023
2 parents fb232b7 + d772b48 commit 4d22a5e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
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
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
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion shell/check.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh -l

if [[ $(allowFix) == "false" ]]; then
echo "Check the code style..."
codestyle --test

exitcode=$?
Expand Down
3 changes: 1 addition & 2 deletions shell/dependabot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions shell/editorconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions shell/fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions shell/normalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4d22a5e

Please sign in to comment.