xref: /dokuwiki/.github/workflows/autoFix.yml (revision bf7ba4d5b4ef44432fb41a6f3461934f51fa5ed3)
1077b7fe2SAndreas Gohrname: "Auto-Fix code"
2077b7fe2SAndreas Gohron:
3077b7fe2SAndreas Gohr  push:
4077b7fe2SAndreas Gohr    branches:
5077b7fe2SAndreas Gohr      - autofix
6077b7fe2SAndreas Gohr
7077b7fe2SAndreas Gohrjobs:
8077b7fe2SAndreas Gohr  autofix:
9077b7fe2SAndreas Gohr    runs-on: ubuntu-latest
10077b7fe2SAndreas Gohr    steps:
11077b7fe2SAndreas Gohr      - name: Checkout
12077b7fe2SAndreas Gohr        uses: actions/checkout@v3
13077b7fe2SAndreas Gohr        with:
14077b7fe2SAndreas Gohr          fetch-depth: 0
15077b7fe2SAndreas Gohr
16077b7fe2SAndreas Gohr      - name: Setup PHP
17077b7fe2SAndreas Gohr        uses: shivammathur/setup-php@v2
18077b7fe2SAndreas Gohr        with:
19077b7fe2SAndreas Gohr          php-version: '8.2'
20077b7fe2SAndreas Gohr          tools: phpcbf, rector
21077b7fe2SAndreas Gohr
22077b7fe2SAndreas Gohr      - name: Setup Cache
23077b7fe2SAndreas Gohr        uses: actions/cache@v3
24077b7fe2SAndreas Gohr        with:
25077b7fe2SAndreas Gohr          path: _test/.rector-cache
26077b7fe2SAndreas Gohr          key: ${{ runner.os }}-rector-${{ hashFiles('_test/rector.php') }}
27077b7fe2SAndreas Gohr
28077b7fe2SAndreas Gohr      - name: Run Rector
29077b7fe2SAndreas Gohr        run: rector process --config _test/rector.php --no-diffs
30077b7fe2SAndreas Gohr
31077b7fe2SAndreas Gohr      - name: Run PHP CodeSniffer autofixing
32077b7fe2SAndreas Gohr        run: phpcbf --standard=_test/phpcs_MigrationAdjustments.xml
33077b7fe2SAndreas Gohr
34077b7fe2SAndreas Gohr      - name: Create Pull Request
35077b7fe2SAndreas Gohr        uses: peter-evans/create-pull-request@v4
36077b7fe2SAndreas Gohr        with:
37*bf7ba4d5SAndreas Gohr          commit-message: "�� Rector and PHPCS fixes"
38*bf7ba4d5SAndreas Gohr          title: "�� Automatic code style fixes"
39*bf7ba4d5SAndreas Gohr          body: |
40*bf7ba4d5SAndreas Gohr            Currently work in progress, do not merge!
41*bf7ba4d5SAndreas Gohr
42*bf7ba4d5SAndreas Gohr            These changes were made automatically by running rector and phpcbf.
43*bf7ba4d5SAndreas Gohr
44*bf7ba4d5SAndreas Gohr            Please carefully check the changes before merging. Please note that
45*bf7ba4d5SAndreas Gohr            unit tests are not run for automated pull requests - so if in doubt,
46*bf7ba4d5SAndreas Gohr            manually test the branch before merging.
47*bf7ba4d5SAndreas Gohr
48*bf7ba4d5SAndreas Gohr            If you disagree with the changes, simply clean the code yourself and
49*bf7ba4d5SAndreas Gohr            create a new pull request. This PR automatically closes when no more
50*bf7ba4d5SAndreas Gohr            changes are suggested by rector and phpcbf.
51077b7fe2SAndreas Gohr          delete-branch: true
52077b7fe2SAndreas Gohr          branch: "bot/autofix"
53