xref: /dokuwiki/.github/workflows/autoFix.yml (revision 077b7fe2fa650a6495f4e9fa288d8e89b73e8b8c)
1*077b7fe2SAndreas Gohrname: "Auto-Fix code"
2*077b7fe2SAndreas Gohron:
3*077b7fe2SAndreas Gohr  push:
4*077b7fe2SAndreas Gohr    branches:
5*077b7fe2SAndreas Gohr      - autofix
6*077b7fe2SAndreas Gohr
7*077b7fe2SAndreas Gohrjobs:
8*077b7fe2SAndreas Gohr  autofix:
9*077b7fe2SAndreas Gohr    runs-on: ubuntu-latest
10*077b7fe2SAndreas Gohr    steps:
11*077b7fe2SAndreas Gohr      - name: Checkout
12*077b7fe2SAndreas Gohr        uses: actions/checkout@v3
13*077b7fe2SAndreas Gohr        with:
14*077b7fe2SAndreas Gohr          fetch-depth: 0
15*077b7fe2SAndreas Gohr
16*077b7fe2SAndreas Gohr      - name: Setup PHP
17*077b7fe2SAndreas Gohr        uses: shivammathur/setup-php@v2
18*077b7fe2SAndreas Gohr        with:
19*077b7fe2SAndreas Gohr          php-version: '8.2'
20*077b7fe2SAndreas Gohr          tools: phpcbf, rector
21*077b7fe2SAndreas Gohr
22*077b7fe2SAndreas Gohr      - name: Setup Cache
23*077b7fe2SAndreas Gohr        uses: actions/cache@v3
24*077b7fe2SAndreas Gohr        with:
25*077b7fe2SAndreas Gohr          path: _test/.rector-cache
26*077b7fe2SAndreas Gohr          key: ${{ runner.os }}-rector-${{ hashFiles('_test/rector.php') }}
27*077b7fe2SAndreas Gohr
28*077b7fe2SAndreas Gohr      - name: Run Rector
29*077b7fe2SAndreas Gohr        run: rector process --config _test/rector.php --no-diffs
30*077b7fe2SAndreas Gohr
31*077b7fe2SAndreas Gohr      - name: Run PHP CodeSniffer autofixing
32*077b7fe2SAndreas Gohr        run: phpcbf --standard=_test/phpcs_MigrationAdjustments.xml
33*077b7fe2SAndreas Gohr
34*077b7fe2SAndreas Gohr      - name: Create Pull Request
35*077b7fe2SAndreas Gohr        uses: peter-evans/create-pull-request@v4
36*077b7fe2SAndreas Gohr        with:
37*077b7fe2SAndreas Gohr          commit-message: "Rector and PHPCS fixes"
38*077b7fe2SAndreas Gohr          title: "Rector and PHPCS fixes"
39*077b7fe2SAndreas Gohr          body: "These changes were made automatically by running rector and phpcbf. Note this is currently WIP and should not be merged!"
40*077b7fe2SAndreas Gohr          delete-branch: true
41*077b7fe2SAndreas Gohr          branch: "bot/autofix"
42