Skip to content
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

Why the git 2.18 is required, there is no explanation in README #170

Closed
phadej opened this issue Feb 29, 2020 · 8 comments
Closed

Why the git 2.18 is required, there is no explanation in README #170

phadej opened this issue Feb 29, 2020 · 8 comments
Labels
question Further information is requested

Comments

@phadej
Copy link

phadej commented Feb 29, 2020

As Ubuntu LTS-18.04 ships git-1.17.1 this is a frustrating limitation, as one needs to update git in virtually any docker container used, when you care about having .git folder present.

@ericsciple
Copy link
Contributor

Checkout v2 was optimized to fetch a single commit - requires Git wire protocol v2.

@phadej
Copy link
Author

phadej commented Mar 1, 2020

Is the alternative to use raw git clone + git checkout commands if I want to use github actions on as vanilla Ubuntu LTS images as possible?

EDIT: We are testing git integration, so it's actually desirable to also use older versions. Does GitHub have any stats what versions of clients is used to access the site?

@stevehobbsdev
Copy link

stevehobbsdev commented Mar 6, 2020

@phadej Can I ask how you are updating Git?

I'm using the circleci/ruby:2.4.1-node-browsers docker image, and I'm using the following commands:

sudo apt-get install python-software-properties software-properties-common
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version

But this fails:

Err http://http.us.debian.org jessie-backports/main Sources
  404  Not Found [IP: 64.50.233.100 80]

I'm having to do this because actions/checkout fails on my build with the error (using Git 2.1.4):

##[error]EACCES: permission denied, open '/__w/ocs-website-rebuild/ocs-website-rebuild/577d8b45-e925-465b-9cc8-5831813609ad.tar.gz'

I'm assuming that if I can upgrade it to 2.18 then it can just do a normal git clone and not have to download a TGZ file (getting around the permissions issue). But my assumptions might be way off.

@phadej
Copy link
Author

phadej commented Mar 6, 2020

@stevehobbsdev PPA works only with Ubuntu, and jessie is Debian.

I currently use

      - name: Checkout
        run: |
          git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
          git fetch origin $GITHUB_REF:temporary-ci-branch
          git checkout $GITHUB_SHA

step. It seems to work, but I'm quite sure I'm missing something.

@tariqc80
Copy link

tariqc80 commented Apr 9, 2020

I'm experiencing this issue too.

Checkout v2 was optimized to fetch a single commit - requires Git wire protocol v2.

@ericsciple The benefit of fetching a single commit clone is lost when using the ubuntu-latest image, which is widely used. Instead of a file sync when the git version is < 2.18, it would be convenient if the plugin performed a shallow clone of a single branch. This is supported in 2.11 with the --depth 1 and --branch options

@ericsciple ericsciple added the question Further information is requested label Apr 15, 2020
@ericsciple
Copy link
Contributor

@tariqc80 ubuntu-latest has git version 2.26.0

Here is my workflow:

on: push
jobs:
  build:
    runs-on: [ubuntu-latest]
    steps:
      - run: git --version

Using branch + depth 1 is a race condition. The ref may move forward before the job begins, especially in workflows with a graph of jobs.

@ericsciple
Copy link
Contributor

...which is why checkout@v2 fetches the SHA instead

@tariqc80
Copy link

@ericsciple Thanks for the response. I didn't realize that the job I was working with was using a container built from Debian Stretch; which ships with git v2.11.

Now I understand the difference between runs-on and container. Updating the git version in the container got me working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants