-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (54 loc) · 1.96 KB
/
Copy pathprettier.yml
File metadata and controls
63 lines (54 loc) · 1.96 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Code formatting
on:
schedule:
- cron: '15 4 2 * *' # At 04:05 on day-of-month 2.
workflow_dispatch:
jobs:
formatting:
name: Code formatting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.17.0
- name: Run make clean
run: make clean
- name: Run make init-javascript
run: make init-javascript
- name: Run make prettier
run: make prettier
# Commit results back to repository
- name: Commit changes
id: auto-commit
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit_message: "chore: Code formatting via `make prettier`"
branch: main
commit_user_name: "GitHub Actions Bot"
commit_user_email: "actions@github.com"
commit_author: "GitHub Actions Bot <actions@github.com>"
skip_push: true
- name: Configure git identity for rebase
if: steps.auto-commit.outputs.changes_detected == 'true'
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
- name: Push changes with retry
if: steps.auto-commit.outputs.changes_detected == 'true'
run: |
max_retries=3
for attempt in $(seq 1 $max_retries); do
echo "Push attempt $attempt of $max_retries"
if git push origin main; then
echo "Push succeeded on attempt $attempt"
exit 0
fi
echo "Push failed, pulling with rebase and retrying..."
git pull --rebase origin main
sleep $((attempt * 2))
done
echo "Push failed after $max_retries attempts"
exit 1