Create PR is failing when using submodules (but only changes in the root repo)
See original GitHub issueSubject of the issue
Hi, we are using submodules and this action. We are only doing changes to the “root” repo and not any submodule. When its time to create the PR it fails:
# ... everything works
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --unshallow --force origin auto-updater/patch:refs/remotes/origin/auto-updater/patch
# ^ works
/usr/bin/git checkout --progress auto-updater/patch --
error: The following untracked working tree files would be overwritten by checkout:
my-submodule/file1.txt
my-submodule/file2.txt
This is probably because of the --no-recurse-submodules
setting.
Steps to reproduce
workflow
- uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.MY_TOKEN }}
- run: date > test.txt
- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
...
Any help is appreciated!
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Git will not init/sync/update new submodules
When a repo with submodules has been set up correctly and someone ... PS: Make sure you are in the root git directory,...
Read more >Git Submodules: Adding, Using, Removing, Updating
Basically I'd like to pull some libraries as submodules within my main repository and using your approach made this easy. However, I'd now...
Read more >Issues · peter-evans/create-pull-request
A GitHub action to create a pull request for changes to your repository ... Create PR is failing when using submodules (but only...
Read more >Effectively Working with Git Submodules
Therefore we found it better to switch to submodule repository and create branch there, make changes, add unit tests, verify, create PR, review ......
Read more >Mastering Git submodules
Only later do all the pitfalls and traps come and bite everyone, every day. ... Working around this by littering your submodule repo...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, understood. I will look at finding a way to fix this when I have some time.
In the meantime, there is a potential workaround. This is how it works:
needs:
keywordI’ve made the test repository I was using public. You can have a look at the tests and runs here: https://github.com/peter-evans/cpr-submodules/blob/main/.github/workflows/test.yml