From 672408b1dbf630b8db43bdbb709b896c01cd84c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Sch=C3=B6nfeldt?= Date: Mon, 10 May 2021 18:01:39 +0200 Subject: [PATCH 1/2] Update README.md Use latest action version in example :-) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e689898..d2971f4 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ jobs: ref: ${{ github.head_ref }} - name: Prettify code - uses: creyD/prettier_action@v3.1 + uses: creyD/prettier_action@v3.3 with: # This part is also where you can pass other options, for example: prettier_options: --write **/*.{js,md} @@ -83,7 +83,7 @@ jobs: fetch-depth: 0 - name: Prettify code - uses: creyD/prettier_action@v3.1 + uses: creyD/prettier_action@v3.3 with: # This part is also where you can pass other options, for example: prettier_options: --write **/*.{js,md} From 707db7683735a7823f4524d4b7c1f86ff8dc94c5 Mon Sep 17 00:00:00 2001 From: Steve Lacy Date: Thu, 20 May 2021 09:39:31 -1000 Subject: [PATCH 2/2] Add input git push options --- README.md | 1 + action.yml | 3 +++ entrypoint.sh | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d2971f4..1b3fb6d 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ A GitHub action for styling files with [prettier](https://prettier.io). | prettier_version | :x: | `false` | Specific prettier version (by default use latest) | | prettier_options | :x: | `"--write **/*.js"` | Prettier options (by default it applies to the whole repository) | | commit_options | :x: | - | Custom git commit options | +| 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` | | file_pattern | :x: | `*` | Custom git add file pattern, can't be used with only_changed! | diff --git a/action.yml b/action.yml index a0d155c..383ea4d 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,9 @@ inputs: commit_options: description: Commit options required: false + push_options: + description: Git push options + required: false file_pattern: description: File pattern used for `git add`, can't be used with only_changed! required: false diff --git a/entrypoint.sh b/entrypoint.sh index 023e697..b7029a5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -81,7 +81,7 @@ if _git_changed; then 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 push origin + git push origin $INPUT_PUSH_OPTIONS fi echo "Changes pushed successfully." fi