From 1cf90df77eb1964b20b218df5571310b436fd7b0 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 26 Jun 2023 14:49:57 +0300 Subject: [PATCH] Update and rename lint-fixer.yml to code-style.yml --- .github/workflows/code-style.yml | 26 ++++++++++++++++++++++++++ .github/workflows/lint-fixer.yml | 19 ------------------- 2 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/code-style.yml delete mode 100644 .github/workflows/lint-fixer.yml 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