Skip to content

Commit

Permalink
Merge pull request #53 from stevelacy/master
Browse files Browse the repository at this point in the history
Add input git push options
  • Loading branch information
creyD authored May 21, 2021
2 parents d9d644a + 707db76 commit bb9aa74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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! |
Expand Down Expand Up @@ -53,7 +54,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}
Expand Down Expand Up @@ -83,7 +84,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}
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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
Expand Down

0 comments on commit bb9aa74

Please sign in to comment.