File tree Expand file tree Collapse file tree 1 file changed +44
-5
lines changed
Expand file tree Collapse file tree 1 file changed +44
-5
lines changed Original file line number Diff line number Diff line change 1- name : Compress
1+ name : Compress Images
22
33on :
4+ pull_request :
5+ paths :
6+ - ' **.jpg'
7+ - ' **.jpeg'
8+ - ' **.png'
9+ - ' **.webp'
410 push :
5- branches : [ master ]
11+ branches :
12+ - main
13+ paths :
14+ - ' **.jpg'
15+ - ' **.jpeg'
16+ - ' **.png'
17+ - ' **.webp'
18+ workflow_dispatch :
19+ schedule :
20+ - cron : ' 00 23 * * 0'
621
722jobs :
8- compress :
9- name : Images
23+ build :
24+ name : calibreapp/image-actions
1025 runs-on : ubuntu-latest
26+ # Only run on main repo on and PRs that match the main repo.
27+ if : |
28+ github.repository == 'AlexRogalskiy/java-patterns' &&
29+ (github.event_name != 'pull_request' ||
30+ github.event.pull_request.head.repo.full_name == github.repository)
1131 steps :
1232 - name : Checkout repository
1333 uses : actions/checkout@v2
2444 run : echo ${{ steps.find.outputs.ignore }} | tr ',' '\n'
2545
2646 - name : Compress Images
27- uses : calibreapp/image-actions@master
47+ id : calibre
48+ uses : calibreapp/image-actions@main
2849 with :
50+ jpegQuality : ' 80'
51+ jpegProgressive : false
52+ pngQuality : ' 80'
53+ webpQuality : ' 80'
2954 ignorePaths : ${{ steps.find.outputs.ignore }}
3055 githubToken : ${{ secrets.GITHUB_TOKEN }}
56+ # For non-Pull Requests, run in compressOnly mode and we'll PR after.
57+ compressOnly : ${{ github.event_name != 'pull_request' }}
58+
59+ - name : Create Pull Request
60+ # If it's not a Pull Request then commit any changes as a new PR.
61+ if : |
62+ github.event_name != 'pull_request' &&
63+ steps.calibre.outputs.markdown != ''
64+ uses : peter-evans/create-pull-request@v3
65+ with :
66+ title : Auto Compress Images
67+ branch-suffix : timestamp
68+ commit-message : Compress Images
69+ body : ${{ steps.calibre.outputs.markdown }}
You can’t perform that action at this time.
0 commit comments