Fixed action failure when the .distignore file is not present in repo. #137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
As reported in #136, the action(version 2.2.1) fails when the .distignore file is not present in the repo.
This issue was introduced in #130. #130 added support for including build files in SVN when the action is used without a BUILD_DIR and .distignore file. In order to achieve this, the
git commit
command was added without checking if there were any untracked files to add and commit. Running git commit on a clean working tree results in a failure with the message (nothing to commit, working tree clean).This PR fixes the issue by adding a condition for untracked files check and only running git commit if untracked files are present.
Closes #136
How to test the Change
dry-run
The test I have done on the sample repo: https://github.com/iamdharmesh/GlotPress/actions/runs/6109282764/job/16579976180
Changelog Entry
Credits
Props @iamdharmesh @dkotter
Checklist: