solidity-docs / .github

22 stars 29 forks source link

Keep bot checkout outside of translation repo #41

Closed cameel closed 1 year ago

cameel commented 1 year ago

The sync action keeps failing in cases where there are no new updates even though #34 should have fixed that. I took a closer look at it today and e.g. in 3635205337 it seems that the problem is caused by the .github-workflow/ dir:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .github-workflow/

This is the directory where the action keeps a clone of the bot repo. Looks like the issue is that the translation repo gets cloned into the default working directory and the bot repo ends up as a subdirectory in it. Git sees it as an untracked file and the check for clean state fails.

This PR fixes that by putting both repos in separate directories.

This, however, uncovered another problem where the script did not account for the situation where there are zero changes upstream (it ended up amending last commit on develop in that situation because there is no merge commit created). The PR adjusts the logic to commit explicitly only when necessary (i.e. when there are merge conflicts).

I tested this in the German repo:

I hope this solves issue with the failing action.