mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-16 21:30:31 +02:00
Merge pull request #53 from stevelacy/master
Add input git push options
This commit is contained in:
@@ -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_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) |
|
| prettier_options | :x: | `"--write **/*.js"` | Prettier options (by default it applies to the whole repository) |
|
||||||
| commit_options | :x: | - | Custom git commit options |
|
| 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) |
|
| 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_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! |
|
| file_pattern | :x: | `*` | Custom git add file pattern, can't be used with only_changed! |
|
||||||
@@ -53,7 +54,7 @@ jobs:
|
|||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
- name: Prettify code
|
- name: Prettify code
|
||||||
uses: creyD/prettier_action@v3.1
|
uses: creyD/prettier_action@v3.3
|
||||||
with:
|
with:
|
||||||
# This part is also where you can pass other options, for example:
|
# This part is also where you can pass other options, for example:
|
||||||
prettier_options: --write **/*.{js,md}
|
prettier_options: --write **/*.{js,md}
|
||||||
@@ -83,7 +84,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Prettify code
|
- name: Prettify code
|
||||||
uses: creyD/prettier_action@v3.1
|
uses: creyD/prettier_action@v3.3
|
||||||
with:
|
with:
|
||||||
# This part is also where you can pass other options, for example:
|
# This part is also where you can pass other options, for example:
|
||||||
prettier_options: --write **/*.{js,md}
|
prettier_options: --write **/*.{js,md}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ inputs:
|
|||||||
commit_options:
|
commit_options:
|
||||||
description: Commit options
|
description: Commit options
|
||||||
required: false
|
required: false
|
||||||
|
push_options:
|
||||||
|
description: Git push options
|
||||||
|
required: false
|
||||||
file_pattern:
|
file_pattern:
|
||||||
description: File pattern used for `git add`, can't be used with only_changed!
|
description: File pattern used for `git add`, can't be used with only_changed!
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ if _git_changed; then
|
|||||||
git push origin -f
|
git push origin -f
|
||||||
else
|
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" --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
|
fi
|
||||||
echo "Changes pushed successfully."
|
echo "Changes pushed successfully."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user