Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nothing to commit, working tree clean #42

Closed
bandantonio opened this issue Nov 1, 2021 · 7 comments
Closed

nothing to commit, working tree clean #42

bandantonio opened this issue Nov 1, 2021 · 7 comments
Labels
question Further information is requested

Comments

@bandantonio
Copy link

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
Copy link
Author

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.

@cpina
Copy link
Owner

cpina commented Dec 8, 2021

@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 cpina added the question Further information is requested label Dec 8, 2021
@drewdecarme
Copy link

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
Copy link

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 :)

@cpina
Copy link
Owner

cpina commented Jan 22, 2022

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
Copy link
Owner

cpina commented Sep 5, 2022

I've opened #79 to re-verify and action. Thanks for the report.

@cpina cpina closed this as completed Sep 5, 2022
@Nickman87
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants