Skip to content

Commit 977086d

Browse files
committed
autofix
1 parent 8638f52 commit 977086d

File tree

3 files changed

+89
-82
lines changed

3 files changed

+89
-82
lines changed

.github/workflows/autofix.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: fixer
2+
3+
on:
4+
push:
5+
branches: [ 10.x ]
6+
pull_request:
7+
branches: [ 10.x ]
8+
9+
jobs:
10+
autofix:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: 8.1
21+
extensions: mbstring, pgsql, mysql, sqlite, redis, memcached, bcmath
22+
coverage: pcov
23+
env:
24+
runner: self-hosted
25+
26+
- name: Validate composer.json and composer.lock
27+
run: composer validate --strict
28+
29+
- name: Cache Composer packages
30+
id: composer-cache
31+
uses: actions/cache@v4
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-php-
37+
38+
- name: Install dependencies
39+
run: composer install --prefer-dist --no-progress
40+
41+
- name: Run rector-fix
42+
run: composer rector-fix
43+
44+
- name: Run ecs-fix
45+
run: composer ecs-fix
46+
47+
- name: Run rector
48+
run: composer rector
49+
50+
- name: Run ecs
51+
run: composer ecs
52+
53+
- name: Run parabench
54+
run: composer parabench
55+
56+
- name: "Check if build has changed"
57+
if: success()
58+
id: has-changes
59+
run: |
60+
echo "stdout<<EOF" >> $GITHUB_OUTPUT
61+
echo "$(git diff --stat)" >> $GITHUB_OUTPUT
62+
echo 'EOF' >> $GITHUB_OUTPUT
63+
64+
- name: Import GPG key
65+
if: ${{ steps.has-changes.outputs.stdout }}
66+
uses: crazy-max/ghaction-import-gpg@v6
67+
with:
68+
gpg_private_key: ${{ secrets.GPG_BOT }}
69+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
70+
fingerprint: ${{ secrets.GPG_FINGERPRINT }}
71+
git_config_global: true
72+
git_user_signingkey: true
73+
git_commit_gpgsign: true
74+
git_committer_name: Github bot
75+
git_committer_email: [email protected]
76+
77+
- name: "Commit files"
78+
if: ${{ steps.has-changes.outputs.stdout }}
79+
env:
80+
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
81+
run: |
82+
gh pr checkout ${{ github.event.pull_request.number }}
83+
git commit -S -m "autofix" -a
84+
85+
- name: "Push changes"
86+
if: ${{ steps.has-changes.outputs.stdout }}
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
89+
run: git push -u origin HEAD

.github/workflows/code-style.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/rector.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)