Skip to content

Commit

Permalink
Commit build files only if untracked files are present.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Sep 7, 2023
1 parent bdc4de6 commit 3fb8ff6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ if [[ "$BUILD_DIR" = false ]]; then
git config --global user.name "10upbot on GitHub"

# Ensure git archive will pick up any changed files in the directory try.
test $(git ls-files --deleted) && git rm $(git ls-files --deleted)
git add .
git commit -m "Include build step changes"
test $(git ls-files --deleted) && git rm $(git ls-files --deleted)
if [ -n "$(git status --porcelain --untracked-files=all)" ]; then
git add .
git commit -m "Include build step changes"
fi

# If there's no .gitattributes file, write a default one into place
if [[ ! -e "$GITHUB_WORKSPACE/.gitattributes" ]]; then
Expand Down

0 comments on commit 3fb8ff6

Please sign in to comment.