github-action-push-to-another-repository icon indicating copy to clipboard operation
github-action-push-to-another-repository copied to clipboard

nothing to commit, working tree clean

Open bandantonio opened this issue 2 years ago • 5 comments

Hi No matter what I do, I'm constantly seeing this in logs:

[+] Adding git commit
[+] git status:
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
[+] git diff-index:
[+] Pushing git commit
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 

The job sees source and target directories correctly but even after merging a PR to master, it can't track new changes. Can't figure out what I'm doing wrong.

bandantonio avatar Nov 01 '21 12:11 bandantonio

Another question: As I can see from the current behavior, the action works only with the master (source) branch. Is it possible to define a custom source branch? It would be extremely useful for testing purposes.

bandantonio avatar Nov 01 '21 12:11 bandantonio

@bandantonio : if you are still trying to use it: could you link to the repository so I can see the file .github/workflows/ci.yml? I might be able to help in this case.

The custom source branch should be the branch that is executed by the Action. The script is not doing a checkout of the source repository (the files are already there when this step is executed, possibly by the step actions/checkout@v2.

cpina avatar Dec 08 '21 23:12 cpina

I'm having the same issue at the moment. When I run the checkout before the script, it finds all of the files but then it says that there's nothing to commit. In addition, checking out the repo also causes a 403.

Here's a log of the action: https://github.com/the-montessori-woodshop/the-montessori-woodshop/runs/4574401075?check_suite_focus=true

Here's the GitHub action.yml file: https://github.com/the-montessori-woodshop/the-montessori-woodshop/blob/main/.github/workflows/main.yml

drewdecarme avatar Dec 19 '21 13:12 drewdecarme

Turns out the issue I had was that I was trying to copy the root of my source directory with the .git folder inside of it. Copying that to the root of the destination repository was causing issues. I instead added a target-directory to the script and everything worked great :)

drewdecarme avatar Dec 20 '21 14:12 drewdecarme

Thanks @drewdecarme for the update. I want to spend some time writing tests (#59) and I will add one for this and try to fix it. No ETA yet :-( but I'm happy that it's all good for you! :-)

cpina avatar Jan 22 '22 21:01 cpina

I've opened https://github.com/cpina/github-action-push-to-another-repository/issues/79 to re-verify and action. Thanks for the report.

cpina avatar Sep 05 '22 23:09 cpina

Had the same issue, fixed it by adding - run: rm -rf .git before calling the push action.

It only started happening for me when I moved this action into a seperate workflow AND when I changed up the target branch(es) to new ones (to differentiate between staging and production). It worked just fine before I changed the target.

Nickman87 avatar Jan 06 '23 21:01 Nickman87