xref: /dokuwiki/.github/workflows/autoFix.yml (revision 316e3ee67cce340deac79a8c6f89d881b178d094)
1name: "Auto-Fix code"
2on:
3  push:
4    branches:
5      - autofix
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            Currently work in progress, do not merge!
41
42            These changes were made automatically by running rector and phpcbf.
43
44            Please carefully check the changes before merging. Please note that
45            unit tests are not run for automated pull requests - so if in doubt,
46            manually test the branch before merging.
47
48            If you disagree with the changes, simply clean the code yourself and
49            create a new pull request. This PR automatically closes when no more
50            changes are suggested by rector and phpcbf.
51          delete-branch: true
52          branch: "bot/autofix"
53