diff --git a/README.md b/README.md index 4d0fb81..78239a7 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ A GitHub action for styling files with [prettier](https://prettier.io). | push_options | :x: | - | Custom git push options | | same_commit | :x: | `false` | Update the current commit instead of creating a new one, created by [Joren Broekema](https://github.com/jorenbroekema), this command works only with the checkout action set to fetch depth '0' (see example 2) | | commit_message | :x: | `"Prettified Code!"` | Custom git commit message, will be ignored if used with `same_commit` | +| commit_description | :x: | - | Custom git extended commit message, will be ignored if used with `same_commit` | | file_pattern | :x: | `*` | Custom git add file pattern, can't be used with only_changed! | | prettier_plugins | :x: | - | Install Prettier plugins, i.e. `@prettier/plugin-php @prettier/plugin-other` | | only_changed | :x: | `false` | Only prettify changed files, can't be used with file_pattern! This command works only with the checkout action set to fetch depth '0' (see example 2)| diff --git a/action.yml b/action.yml index 3217353..691269a 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: description: Commit message, will be ignored if used with same_commit required: false default: "Prettified Code!" + commit_description: + description: Extended commit message, will be ignored if used with same_commit + required: false + default: "" same_commit: description: Update the current commit instead of creating a new one required: false @@ -58,6 +62,7 @@ runs: ${{ github.action_path }}/entrypoint.sh env: INPUT_COMMIT_MESSAGE: ${{ inputs.commit_message }} + INPUT_COMMIT_DESCRIPTION: ${{ inputs.commit_description }} INPUT_SAME_COMMIT: ${{ inputs.same_commit }} INPUT_COMMIT_OPTIONS: ${{ inputs.commit_options }} INPUT_FILE_PATTERN: ${{ inputs.file_pattern }} diff --git a/entrypoint.sh b/entrypoint.sh index d3a358b..b8216b4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -109,7 +109,7 @@ if _git_changed; then git commit --amend --no-edit git push origin -f else - git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} || echo "No files added to commit" + git commit -m "$INPUT_COMMIT_MESSAGE" if [ "$INPUT_COMMIT_DESCRIPTION" != "" ]; then echo '-m "$INPUT_COMMIT_DESCRIPTION"' fi --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} || echo "No files added to commit" git push origin ${INPUT_PUSH_OPTIONS:-} fi echo "Changes pushed successfully."