mirror of
https://github.com/creyD/crush_action.git
synced 2026-04-12 11:40:30 +02:00
Added custom folder option
This commit is contained in:
@@ -12,6 +12,7 @@ GitHub action for automatic lossless image compression using OptiPNG for PNG com
|
||||
| commit_message | :x: | Prettified Code! | Custom git commit message |
|
||||
| file_pattern | :x: | * | Custom git add file pattern |
|
||||
| branch | :white_check_mark: | - | There are two types of action triggers in GitHub: on pull request and on push. The branch needs to be defined for both, but in case of the pull request trigger it should have `${{ github.head_ref }}` and on push it should have the branch the trigger is designed for. |
|
||||
| folder | :x: | . | Custom search folder, if you don't want to search the whole repository. |
|
||||
|
||||
### Example Config
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ inputs:
|
||||
branch:
|
||||
description: Target branch for the changes
|
||||
required: true
|
||||
folder:
|
||||
description: Starting folder for recursive search
|
||||
required: false
|
||||
default: '.'
|
||||
|
||||
runs:
|
||||
using: 'docker'
|
||||
|
||||
@@ -36,9 +36,10 @@ _git_push() {
|
||||
}
|
||||
|
||||
# PROGRAM
|
||||
find . -type f -name "*.jpg" -exec jpegoptim {} \;
|
||||
find . -type f -name "*.jpeg" -exec jpegoptim {} \;
|
||||
find . -type f -name "*.png" -exec optipng -nc -nb -o7 {} \;
|
||||
find $INPUT_FOLDER -type f -name "*.jpg" -exec jpegoptim {} \;
|
||||
find $INPUT_FOLDER -type f -name "*.jpeg" -exec jpegoptim {} \;
|
||||
# nc nb are so that no color information is lost
|
||||
find $INPUT_FOLDER -type f -name "*.png" -exec optipng -nc -nb -o7 {} \;
|
||||
|
||||
# To keep runtime good, just continue if something was changed
|
||||
if _git_changed;
|
||||
|
||||
Reference in New Issue
Block a user