-
Notifications
You must be signed in to change notification settings - Fork 35
41 lines (34 loc) · 956 Bytes
/
Copy pathoptimize.yml
File metadata and controls
41 lines (34 loc) · 956 Bytes
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
name: Optimize Action
on:
push:
path-ignore:
- 'scripts/**'
jobs:
optimize-and-commit-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Optimize
run: |
python scripts/optimizer.py
- name: Commit
run: |
status_log=$(git status -sb)
if [ "$status_log" == "## main...origin/main" ];then
echo "nothing to commit, working tree clean"
else
echo "commit..."
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git add .
git commit -m "optimize" -a
fi
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.OPTIMIZER_ACCESS_TOKEN }}