Closed pviscone closed 2 years ago
Thanks @pviscone for the report. Now I know what is actually wrong. It is because of commit 3561c1a509bc53ac3bd032430b89d610dd44f02f . You can solve this by checking if there is anything to commit or not using git diff
beforehand.
So the code will be like this:
if git diff --cached --exit-code; then
# Perform git commit
# Then perform git push
fi
You can modify the PR you've made based on this logic (or any other similar logic that you think is better) and test if it will work or not. Then I will accept the PR and release a new patch ;) . Don't hesitate to contact me if you need help meanwhile.
The issue has been fixed via #10 PR.
If the action runs without change to the documentation, the command git commit returns "nothing to commit" and then exit 1 is executed
Assuming that the action is triggered by a push on the main branch you can reproduce the issue just by modifying a file on the main branch without changing the documentation (e.g. add a line to the README.md)
I resolved this issue by changing exit 1 to exit 0 but this will also suppress other real errors from git commit
The log of the action in case of no change to the documentation (in this case I have already modified exit 1 in exit 0 but the important fact is that if there is nothing to commit the exit command is executed):