Skip to content

Commit 938e7fc

Browse files
committed
chore: update compress workflow
1 parent dd42eb3 commit 938e7fc

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/compress.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
name: Compress
22

33
on:
4-
push:
5-
branches: [main]
6-
paths:
7-
- "**.jpg"
8-
- "**.jpeg"
9-
- "**.png"
10-
- "**.webp"
4+
schedule:
5+
- cron: "0 0 * * 3"
116
workflow_dispatch:
127

138
jobs:
@@ -19,18 +14,23 @@ jobs:
1914
uses: actions/checkout@v2
2015

2116
- name: Compress Images
22-
uses: calibreapp/image-actions@master
17+
id: calibre
18+
uses: calibreapp/image-actions@main
2319
with:
2420
githubToken: ${{ secrets.GITHUB_TOKEN }}
2521
compressOnly: true
2622

2723
- name: Commit Files
24+
if: |
25+
steps.calibre.outputs.markdown != ''
2826
run: |
29-
git config --local user.email "action@github.com"
30-
git config --local user.name "GitHub Action"
31-
git commit -m "docs: optimize images" -a
27+
git config --local user.email "szuyanglb@outlook.com"
28+
git config --local user.name "yanglbme"
29+
git commit -m "chore: auto compress images" -a
3230
3331
- name: Push Changes
32+
if: |
33+
steps.calibre.outputs.markdown != ''
3434
uses: ad-m/github-push-action@master
3535
with:
36-
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)