-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
With the recent release of v4.1.4, which was to address #1689, I am continuing to find issues with the behavior from actions/checkout, specifically for older versions of git.
To provide my details, analysis, and suggestions for resolution, I've created this minimal example: https://github.com/hicksjacobp/checkout-test
For summary, actions/checkout@v4.1.4 still causes a repositoryformatversion of 1 to be configured in the repository due to calling sparse-checkout disable. This appears to have been fixed in some version of git after 2.34.1.
The actions/runner image, which is the default image for actions-runner-controller, happens to NOT have a newer version of git than 2.34.1, and further requires adding of the apt feed to even install newer versions than 2.34.1.
The actions/runner image, which is the default image for actions-runner-controller, does not have git installed, nor the current apt feed for obtaining git versions newer than 2.34.1. If you install the GitHub CLI, then git@v2.34.1 is installed, using a Dockerfile definition like so:
FROM ghcr.io/actions/actions-runner:2.316.0@sha256:1a9c7d1bb0896c8a23572452174f517709199e327ca967081936a950a52e9ec1
ENV RUNNER_TOOL_CACHE=/home/runner/_tool
# Switch to root to install dependencies
USER root
# Install common packages
RUN apt update -y \
&& apt install -y --no-install-recommends \
ca-certificates \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install GitHub CLI (gh)
RUN mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update -y \
&& apt install gh -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*My intention with this issue is to raise transparency of the behavior change with actions/checkout@v4.1.4 which is different than actions/checkout@v4.1.1 for users that may not find this very obvious (the previous version which was pullable with v4). There are certainly some workarounds available as I put in the README of my minimal example.