Skip to content

Commit 8789703

Browse files
committed
Setup rector in CI
1 parent f9081ff commit 8789703

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/rector.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on:
5+
pull_request: null
6+
7+
jobs:
8+
rector:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.head.repo.full_name == 'mongodb/mongo-php-library'
11+
steps:
12+
-
13+
if: github.event.pull_request.head.repo.full_name == github.repository
14+
uses: actions/checkout@v3
15+
with:
16+
# Must be used to trigger workflow after push
17+
token: ${{ secrets.ACCESS_TOKEN }}
18+
19+
-
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.1
23+
coverage: none
24+
25+
- uses: "ramsey/composer-install@v2"
26+
27+
- run: vendor/bin/rector --ansi
28+
29+
-
30+
# commit only to core contributors who have repository access
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: '[rector] Rector fixes'
34+
commit_author: 'GitHub Action <[email protected]>'
35+
commit_user_email: '[email protected]'

0 commit comments

Comments
 (0)