-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (44 loc) · 1.28 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: php-cs-fixer
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
php-cs-fixer:
runs-on: ubuntu-20.04
steps:
- name: Setup PHP 7.4
run: sudo update-alternatives --set php /usr/bin/php7.4
- uses: actions/checkout@master
- name: git setting
run: |
git config --local user.email "info@hajimecreate.com"
git config --local user.name "Hajimecreate"
- name: Prepare
run: |
wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
chmod a+x php-cs-fixer
- name: php-cs-fixer
run: php php-cs-fixer fix . --config=php_cs.dist
- uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Run Prettier
run: |
npx prettier --write '**/*.{js,json,md,scss,css,html}' --tab-width 4
- name: Commit and Push
run: |
line=`git diff | wc -l`
if [ $line -eq 0 ]; then
echo "コミットするものがないので終了"
exit 0
fi
git add .
git commit -m "Code fix by Github Action" -a
git pull
git push origin HEAD