File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Compress
22
33on :
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
138jobs :
@@ -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 }}
You can’t perform that action at this time.
0 commit comments