Skip to content

Commit

Permalink
Remove git submodules before git checkout
Browse files Browse the repository at this point in the history
If a git submodule is converted to a regular git directory (e.g. when
moving from dev -> rel-6 branch), the directory is not properly cleaned
by the checkout action.

Remove the git submodule .git files which makes sure that git properly
reinitialize subdirectories, even if they have been a submodule before.

See also: actions/checkout#624
  • Loading branch information
agners committed Oct 26, 2021
1 parent b72acfa commit 657bb9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ jobs:
return { "ref": context.ref }
return { "ref": context.payload.pull_request.head.sha }
# Make sure directories of potentially removed submodules are cleaned correctly
- name: Cleanup git submodules
run: find . -name .git -type f -exec rm {} \;

- name: Checkout source
uses: actions/checkout@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ jobs:
runs-on: ${{ matrix.board.runner }}

steps:
# Make sure directories of potentially removed submodules are cleaned correctly
- name: Cleanup git submodules
run: find . -name .git -type f -exec rm {} \;

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
Expand Down

0 comments on commit 657bb9a

Please sign in to comment.