2020-01-22 01:07:32 +01:00
|
|
|
name: Rector CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request: null
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
rector-ci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-03-11 22:31:16 +01:00
|
|
|
-
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
2020-03-12 13:57:20 +01:00
|
|
|
token: ${{ secrets.ACCESS_TOKEN }}
|
2020-03-11 22:31:16 +01:00
|
|
|
|
2020-01-22 01:07:32 +01:00
|
|
|
-
|
|
|
|
uses: shivammathur/setup-php@v1
|
|
|
|
with:
|
|
|
|
php-version: 7.3
|
|
|
|
coverage: none
|
2020-03-11 22:31:16 +01:00
|
|
|
|
2020-01-22 01:07:32 +01:00
|
|
|
- run: composer install --no-progress
|
|
|
|
- run: composer rector-ci
|
2020-03-11 21:59:06 +01:00
|
|
|
|
|
|
|
-
|
|
|
|
name: Check for modified files
|
|
|
|
id: git-check
|
2020-03-12 22:01:14 +01:00
|
|
|
run: echo ::set-output name=modified::$(if git diff --exit-code -s; then echo "false"; else echo "true"; fi)
|
2020-03-11 21:59:06 +01:00
|
|
|
|
2020-03-12 21:11:38 +01:00
|
|
|
- name: Push changes
|
2020-03-12 13:57:20 +01:00
|
|
|
if: steps.git-check.outputs.modified == 'true'
|
2020-03-11 21:59:06 +01:00
|
|
|
run: |
|
2020-03-12 21:11:38 +01:00
|
|
|
git config --global user.name 'rector-bot'
|
|
|
|
git config --global user.email 'tomas@getrector.org'
|
|
|
|
git commit -am "Bot commit"
|
2020-03-12 13:57:20 +01:00
|
|
|
git push
|
|
|
|
exit 1
|