-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (39 loc) · 1.13 KB
/
codestyle.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
46
47
name: Code style
on:
push:
branches:
- '**'
- '!renovate/**'
jobs:
style-fix:
name: Run Prettier and Commit Changes
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.TAKARO_CI_APP_ID }}
private_key: ${{ secrets.TAKARO_CI_APP_PRIV_KEY }}
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: ./scripts/dev-init.sh
- name: Run Prettier
run: npm run test:style:fix
- name: Commit and push if changed
run: |
if git diff --quiet; then
echo "No changes to commit."
else
git config --global user.name 'takaro-ci-bot[bot]'
git config --global user.email '138661031+takaro-ci-bot[bot]@users.noreply.github.com'
git commit -am "fix: code style"
git push
fi