Moved ignore part to before git checks changed

This commit is contained in:
2021-02-19 19:04:18 +01:00
parent f4e4fcde26
commit c9d8181bcf

View File

@@ -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)