mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-12 19:30:30 +02:00
Moved ignore part to before git checks changed
This commit is contained in:
@@ -59,6 +59,12 @@ echo "Prettifing files..."
|
||||
echo "Files:"
|
||||
prettier $INPUT_PRETTIER_OPTIONS || echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"
|
||||
|
||||
# Ignore node modules and other action created files
|
||||
echo "package_lock.json
|
||||
node_modules/
|
||||
" >> .gitignore
|
||||
git update-index --assume-unchanged .gitignore
|
||||
|
||||
# To keep runtime good, just continue if something was changed
|
||||
if _git_changed; then
|
||||
if $INPUT_DRY; then
|
||||
@@ -68,13 +74,6 @@ if _git_changed; then
|
||||
# Calling method to configure the git environemnt
|
||||
_git_setup
|
||||
|
||||
# Ignore node modules and other action created files
|
||||
echo "package_lock.json
|
||||
node_modules/
|
||||
.gitignore
|
||||
" >> .gitignore
|
||||
git update-index --skip-worktree .gitignore
|
||||
|
||||
if $INPUT_ONLY_CHANGED; then
|
||||
# --diff-filter=d excludes deleted files
|
||||
for file in $(git diff --name-only --diff-filter=d HEAD^..HEAD)
|
||||
|
||||
Reference in New Issue
Block a user