xref: /dokuwiki/.github/workflows/autoFix.yml (revision 615810c59cd1bbc7a6f950fa667bd0c75f92d99a)
1name: "Auto-Fix code"
2on:
3  push:
4    branches:
5      - master
6
7jobs:
8  autofix:
9    runs-on: ubuntu-latest
10    steps:
11      - name: Checkout
12        uses: actions/checkout@v3
13        with:
14          fetch-depth: 0
15
16      - name: Setup PHP
17        uses: shivammathur/setup-php@v2
18        with:
19          php-version: '8.2'
20          tools: phpcbf, rector
21
22      - name: Setup Cache
23        uses: actions/cache@v3
24        with:
25          path: _test/.rector-cache
26          key: ${{ runner.os }}-rector-${{ hashFiles('_test/rector.php') }}
27
28      - name: Run Rector
29        run: rector process --config _test/rector.php --no-diffs
30
31      - name: Run PHP CodeSniffer autofixing
32        run: phpcbf --standard=_test/phpcs_MigrationAdjustments.xml
33
34      - name: Create Pull Request
35        uses: peter-evans/create-pull-request@v4
36        with:
37          commit-message: "�� Rector and PHPCS fixes"
38          title: "�� Automatic code style fixes"
39          body: |
40            These changes were made automatically by running rector and phpcbf.
41
42            Please carefully check the changes before merging. Please note that
43            unit tests are not run for automated pull requests - so if in doubt,
44            manually test the branch before merging.
45
46            If you disagree with the changes, simply clean the code yourself and
47            create a new pull request. This PR automatically closes when no more
48            changes are suggested by rector and phpcbf.
49          delete-branch: true
50          branch: "bot/autofix"
51