Open
Description
How to reproduce:
- Spin off a self-hosted GitHub Actions runner. This is important because for reasons I do not understand or accept (to put it mildly) self-hosted runners are fully stateful and do not clean up in any ways between runs for a specific repository.
- Ensure that an arbitrary workflow containing
actions/checkout@v2
succeeds. Let's say that you have it in a repositorymain-repo
. - Accidentally clone another random repository
other-repo
insidemain-repo
, and thengit add . && git commit -m"" && git push
, effectively addingother-repo
as a submodule tomain-repo
. - Ensure that the workflow runs on push the first time only.
- Re-run. Ensure that it fails like this (here
labs-yeputons
ismain-repo
, andlabs
is theother-repo
that was accidentally add as a submodule):
Run actions/checkout@v2
with:
repository: hse-spb-2020-cpp/labs-yeputons
token: ***
ssh-strict: true
persist-credentials: true
clean: true
fetch-depth: 1
lfs: false
submodules: false
Syncing repository: hse-spb-2020-cpp/labs-yeputons
Getting Git version info
Working directory is '/home/platypus/git/actions-runner/_work/labs-yeputons/labs-yeputons'
/usr/bin/git version
git version 2.25.1
/usr/bin/git config --local --get remote.origin.url
https://github.com/hse-spb-2020-cpp/labs-yeputons
Removing previously created refs, to avoid conflicts
/usr/bin/git rev-parse --symbolic-full-name --verify --quiet HEAD
refs/heads/lab03-list-heap
/usr/bin/git checkout --detach
HEAD is now at d5cced7 break everything by adding submodule
/usr/bin/git rev-parse --symbolic-full-name --branches
refs/heads/lab03-list-heap
/usr/bin/git branch --delete --force lab03-list-heap
Deleted branch lab03-list-heap (was d5cced7).
/usr/bin/git rev-parse --symbolic-full-name --remotes=origin
refs/remotes/origin/lab03-list-heap
Cleaning the repository
/usr/bin/git clean -ffdx
/usr/bin/git reset --hard HEAD
HEAD is now at d5cced7 break everything by adding submodule
Disabling automatic garbage collection
/usr/bin/git config --local gc.auto 0
Setting up auth
/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
Error: fatal: No url found for submodule path 'labs' in .gitmodules
Error: The process '/usr/bin/git' failed with exit code 128
So, after the first workflow run the working directory is forever contaminated and all subsequent builds break even if we reset branch to the previous state. The only way to fix this is to either manually clean up working directory on each affected worker, or to add an extra step to nuke repository before checking it out from scratch.
Metadata
Metadata
Assignees
Labels
No labels