From b84f7abfcf430ac75c39dbdd07b8b10a68109121 Mon Sep 17 00:00:00 2001 From: berfinyuksel Date: Fri, 21 Nov 2025 02:15:31 +0100 Subject: [PATCH 1/3] Migrate to reusable PHP-CS-Fixer workflow (reset from default) --- .github/workflows/new-php-cs-fixer.yaml | 27 +++++++++++++++++++ .github/workflows/php-cs-fixer.yaml.bak | 35 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/new-php-cs-fixer.yaml create mode 100644 .github/workflows/php-cs-fixer.yaml.bak diff --git a/.github/workflows/new-php-cs-fixer.yaml b/.github/workflows/new-php-cs-fixer.yaml new file mode 100644 index 00000000..8edd2968 --- /dev/null +++ b/.github/workflows/new-php-cs-fixer.yaml @@ -0,0 +1,27 @@ +name: "PHP-CS-Fixer" + +on: + pull_request: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + - "feature-*" + push: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + - "*_actions" + - "feature-*" + +permissions: + contents: read + +jobs: + php-cs-fixer: + 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 }} + secrets: + PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }} + diff --git a/.github/workflows/php-cs-fixer.yaml.bak b/.github/workflows/php-cs-fixer.yaml.bak new file mode 100644 index 00000000..8bc4a184 --- /dev/null +++ b/.github/workflows/php-cs-fixer.yaml.bak @@ -0,0 +1,35 @@ +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-*" + +permissions: + contents: read + +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@v2 + 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@v4 + with: + commit_message: Apply php-cs-fixer changes \ No newline at end of file From 38944ada53cdda8f7fac6f6548c7619338216420 Mon Sep 17 00:00:00 2001 From: berfinyuksel Date: Fri, 21 Nov 2025 02:28:10 +0100 Subject: [PATCH 2/3] Fix permissions for reusable PHP-CS-Fixer workflow --- .github/workflows/new-php-cs-fixer.yaml | 35 +++++++++++-------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/new-php-cs-fixer.yaml b/.github/workflows/new-php-cs-fixer.yaml index 8edd2968..7757f325 100644 --- a/.github/workflows/new-php-cs-fixer.yaml +++ b/.github/workflows/new-php-cs-fixer.yaml @@ -1,27 +1,22 @@ name: "PHP-CS-Fixer" on: - pull_request: - branches: - - "[0-9]+.[0-9]+" - - "[0-9]+.x" - - "feature-*" - push: - branches: - - "[0-9]+.[0-9]+" - - "[0-9]+.x" - - "*_actions" - - "feature-*" + pull_request: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + - "feature-*" + push: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + - "*_actions" + - "feature-*" permissions: - contents: read + contents: write jobs: - php-cs-fixer: - 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 }} - secrets: - PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }} - + php-cs-fixer: + uses: pimcore/workflows-collection-public/.github/workflows/reusable-php-cs-fixer.yaml@main + secrets: inherit From aa44bb6209b132eda4d47d916e5988253b8b5181 Mon Sep 17 00:00:00 2001 From: berfinyuksel Date: Fri, 21 Nov 2025 02:34:12 +0100 Subject: [PATCH 3/3] Update new PHP-CS-Fixer workflow --- .github/workflows/new-php-cs-fixer.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/new-php-cs-fixer.yaml b/.github/workflows/new-php-cs-fixer.yaml index 7757f325..ab147768 100644 --- a/.github/workflows/new-php-cs-fixer.yaml +++ b/.github/workflows/new-php-cs-fixer.yaml @@ -19,4 +19,8 @@ permissions: jobs: php-cs-fixer: uses: pimcore/workflows-collection-public/.github/workflows/reusable-php-cs-fixer.yaml@main - secrets: inherit + with: + head_ref: ${{ github.head_ref || github.ref_name }} + repository: ${{ github.repository }} + secrets: + PHP_CS_FIXER_GITHUB_TOKEN: ${{ secrets.PHP_CS_FIXER_GITHUB_TOKEN }}