-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
sparse-checkout not working when running in a container. #1602
Comments
I'm facing the same problem. It isn't working inside a container image; it shows the entire repository. However, it's working fine if I don't use a container. name: AzurePowerShellScript
on: [workflow_dispatch]
jobs:
Resources:
runs-on: ubuntu-latest
container: mcr.microsoft.com/azure-powershell:latest
steps:
- name: Check Out
uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
GHActionTest/
3TierApp/
- name: TestStep
shell: pwsh
run: Get-ChildItem -Recurse #Shows only checked out repo. contents when not using the container image. Is Setting a variable in |
I also encountered this problem. |
I'm using actions/checkout@v4
Sparce checkout parameter doesn't have any effect when running job in a container.
It works fine when running directly on an ubuntu self-hosted runner. But when I tried running using debian or alpine image, it checks out the entire repo.
My guess that it has to do with Git being present in the container.
The logs for Alpine/Debian containers look like this:
Logs when using a runner directly:
The text was updated successfully, but these errors were encountered: