mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-12 19:30:30 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb361e2979 | |||
|
|
ce4e1eba94 | ||
| b0b067ff52 | |||
| 269c9b08c9 | |||
|
|
6f7d0221d4 |
@@ -23,7 +23,7 @@ A GitHub action for styling files with [prettier](https://prettier.io).
|
||||
| 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! |
|
||||
| branch (depreciated with 3.0)| :white_check_mark: | - | Always set this to `${{ github.head_ref }}` in order to work both with pull requests and push events |
|
||||
| branch (deprecated with 3.0)| :white_check_mark: | - | Always set this to `${{ github.head_ref }}` in order to work both with pull requests and push events |
|
||||
| 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)|
|
||||
|
||||
> Note: using the same_commit option may lead to problems if other actions are relying on the commit being the same before and after the prettier action has ran. Keep this in mind.
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
- name: Prettify code
|
||||
uses: creyD/prettier_action@v3.0
|
||||
uses: creyD/prettier_action@v3.1
|
||||
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.0
|
||||
uses: creyD/prettier_action@v3.1
|
||||
with:
|
||||
# This part is also where you can pass other options, for example:
|
||||
prettier_options: --write **/*.{js,md}
|
||||
|
||||
@@ -50,7 +50,8 @@ if _git_changed; then
|
||||
_git_setup
|
||||
|
||||
if $INPUT_ONLY_CHANGED; then
|
||||
for file in $(git diff --name-only HEAD^..HEAD)
|
||||
# --diff-filter=d excludes deleted files
|
||||
for file in $(git diff --name-only --diff-filter=d HEAD^..HEAD)
|
||||
do
|
||||
git add $file
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user