diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 000000000..d68bc6f88 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,34 @@ +name: autofix.ci # needed to securely identify the workflow by the action + +on: + pull_request: + push: + branches: + - master + +jobs: + autofix: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + coverage: none + extensions: mbstring + php-version: 8.3 + + - uses: ramsey/composer-install@v2 + + - run: composer normalize + + - run: composer docs + - run: npx prettier --write --tab-width=2 *.md **/*.md + + - run: vendor/bin/php-cs-fixer fix + + - uses: autofix-ci/action@v1 + with: + commit-message: Autofix diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml deleted file mode 100644 index 041a86ba1..000000000 --- a/.github/workflows/autoformat.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Autoformat - -on: - push: - -jobs: - composer-normalize: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - - uses: shivammathur/setup-php@v2 - with: - coverage: none - extensions: mbstring - php-version: 8.3 - - - uses: ramsey/composer-install@v2 - - - run: composer normalize - - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Normalize composer.json - - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }} - - - uses: shivammathur/setup-php@v2 - with: - coverage: none - extensions: mbstring - php-version: 8.3 - - - uses: ramsey/composer-install@v2 - - - run: composer docs - - - uses: creyD/prettier_action@v4.3 - with: - prettier_options: --write --tab-width=2 *.md **/*.md - commit_message: Prettify docs - - php-cs-fixer: - runs-on: ubuntu-latest - - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. - contents: write - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }} - - - uses: shivammathur/setup-php@v2 - with: - coverage: none - extensions: mbstring - php-version: 8.3 - - - uses: ramsey/composer-install@v2 - - - run: vendor/bin/php-cs-fixer fix - - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Apply php-cs-fixer changes