diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index 6d19d4f..2e0fbbf 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -1,35 +1,23 @@ name: "PHP-CS-Fixer" on: - pull_request_target: - branches: - - "[0-9]+.[0-9]+" - - "[0-9]+.x" - - "feature-*" - push: - branches: - - "[0-9]+.[0-9]+" - - "[0-9]+.x" - - "*_actions" - - "feature-*" + workflow_dispatch: + push: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + - "*_actions" + - "feature-*" permissions: - contents: read + contents: write jobs: - php-cs-fixer: - permissions: - contents: write # for stefanzweifel/git-auto-commit-action to push code in repo - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:latest - - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Apply php-cs-fixer changes + php-style: + uses: pimcore/workflows-collection-public/.github/workflows/reusable-php-cs-fixer.yaml@main + with: + head_ref: ${{ github.head_ref || github.ref_name }} + repository: ${{ github.repository }} + config_file: ".php-cs-fixer.dist.php" + secrets: + PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }}