Fetch fails when post-checkout hook is not existing
Summary
In some of our builds, our pipelines are failing with the gitlab runner version >= 11.8 while trying to remove the post-checkout hook while using a fetch strategy
Steps to reproduce
- Have a repository without a post-checkout hook
- Use the fetch strategy for checking out the code
- Run the container in a new runner
.gitlab-ci.yml
image: node:11-alpine
variables:
SELENIUM_PROMISE_MANAGER: 0
E2E_ENV: 'STAGING'
BUILD_VERSION: 'e2e pipeline build'
test:
variables:
E2E_TEST_PROFILE: 'deployFrontend'
script:
- yarn initialise
- node ./index
functionality_test:
variables:
E2E_TEST_PROFILE: 'functionality'
script:
- yarn initialise
- node ./index
when:
manual
Actual behavior
The gitlab runner fails while trying to delete the hook file with
rm: can't stat '.git/hooks/post-checkout': Not a directory
ERROR: Job failed: exit code 1
Expected behavior
The runner can be executed without problems
Relevant logs and/or screenshots
job log
Running with gitlab-runner 11.9.2 (fa86510e)
on prd-pkr-runner-i-012bfba8a725d2502 csfGzZYp
Using Docker executor with image node:slim ...
Pulling docker image node:slim ...
Using docker image sha256:436a4da2dc7efb04c412486bc740ce9b966a10ca2c57356cbe335be39ac20b79 for node:slim ...
Running on runner-csfGzZYp-project-2617-concurrent-0 via prod-pkr-runner-i-012bfba8a725d2502...
Reinitialized existing Git repository in /builds/shared-services/payment-solutions/e2e-tests/.git/
rm: can't stat '.git/hooks/post-checkout': Not a directory
ERROR: Job failed: exit code 1
Environment description
K8s runner I don't have access to the config at the moment but I can add it later
Used GitLab Runner version
Running with gitlab-runner 11.9.2 (fa86510e)
on prd-pkr-runner-i-012bfba8a725d2502 csfGzZYp
Using Docker executor with image node:slim ...
Edited by 🤖 GitLab Bot 🤖