Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/workflows/rector_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,43 @@ jobs:
coverage: none

- run: composer install --no-progress

## First run Rector
- run: composer rector-ci-fix

-
name: Check for modified files
id: git-check
name: Check for Rector modified files
id: rector-git-check
run: echo ::set-output name=modified::$(if git diff --exit-code --no-patch; then echo "false"; else echo "true"; fi)

- name: Push changes
if: steps.git-check.outputs.modified == 'true'
- name: Git config
if: steps.rector-git-check.outputs.modified == 'true'
run: |
git config --global user.name 'rector-bot'
git config --global user.email 'tomas@getrector.org'
git commit -am "[Rector CI] Fixed Rector issues"
git push

- name: Commit Rector changes
if: steps.rector-git-check.outputs.modified == 'true'
run: git commit -am "fixup! [Rector CI] Fixed Rector issues"

## Now, there might be coding standard issues after running Rector
-
if: steps.rector-git-check.outputs.modified == 'true'
run: composer fix-cs

-
name: Check for CS modified files
if: steps.rector-git-check.outputs.modified == 'true'
id: cs-git-check
run: echo ::set-output name=modified::$(if git diff --exit-code --no-patch; then echo "false"; else echo "true"; fi)

- name: Commit CS changes
if: steps.cs-git-check.outputs.modified == 'true'
run: git commit -am "fixup! [Rector CI] Fixed CS issues"


- name: Push changes
if: steps.rector-git-check.outputs.modified == 'true'
run: git push
# In case we want to fail this job when there are changed files, just add "exit 1"