From 23135339e395050fe1c9bf742be04993a210d660 Mon Sep 17 00:00:00 2001 From: insyri <60794909+insyri@users.noreply.github.com> Date: Fri, 22 Oct 2021 08:49:41 -0400 Subject: [PATCH 1/4] added `commit-description` as option in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4d0fb81..dabf0c1 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 exteneded 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)| From 6296a68dfd7364abd48265b48d33c48801bc7842 Mon Sep 17 00:00:00 2001 From: insyri <60794909+insyri@users.noreply.github.com> Date: Fri, 22 Oct 2021 08:52:00 -0400 Subject: [PATCH 2/4] added `commit-description` as option to action.yml --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 }} From 39357d386aec8ee2998ad788926e6a96172dc24e Mon Sep 17 00:00:00 2001 From: insyri <60794909+insyri@users.noreply.github.com> Date: Fri, 22 Oct 2021 09:03:21 -0400 Subject: [PATCH 3/4] added `$INPUT_COMMIT_DESCRIPTION` to entrypoint.sh im unfamiliar with shell so this is what i did with some research, the inline if statement is just a personal design/formatting choice. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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." From 902197aeb222fe6f283a10b8e6f6a0a1349a10f8 Mon Sep 17 00:00:00 2001 From: insyri <60794909+insyri@users.noreply.github.com> Date: Fri, 22 Oct 2021 09:04:15 -0400 Subject: [PATCH 4/4] typo fix in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dabf0c1..78239a7 100644 --- a/README.md +++ b/README.md @@ -23,7 +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 exteneded 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)|