diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 0000000..9e66aae --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,26 @@ +name: Code Style + +on: [ push, pull_request ] + +permissions: write-all + +jobs: + style: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Detect job name + id: detect + run: | + [[ ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} ]] && NAME="Fix" || NAME="Check" + + echo "name=${NAME}" >> $GITHUB_OUTPUT + + - name: ${{ steps.detect.outputs.name }} the code style + uses: TheDragonCode/codestyler@v3 + with: + github_token: ${{ secrets.COMPOSER_TOKEN }} + fix: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} diff --git a/.github/workflows/lint-fixer.yml b/.github/workflows/lint-fixer.yml deleted file mode 100644 index 184a3a7..0000000 --- a/.github/workflows/lint-fixer.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Code-Style Fixer" - -on: - push: - branches: [ main ] - -jobs: - fix: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Checking PHP Syntax - uses: TheDragonCode/codestyler@v3 - with: - github_token: ${{ secrets.COMPOSER_TOKEN }} - fix: true