title: Github-actions - composer fails with 'sh: git: not found'?
body: <p>I have a wordpress plugin where i'm using composer to define my dependent libaries and github-actions to build the installable package. I plan to publish the vendors folder to a 'build' branch in github so the whole application can be installed.</p>
  
  <p>My <a href="https://github.com/emeraldjava/bhaa_wordpress_plugin/blob/master/composer.json" rel="nofollow noreferrer">composer.json</a> file has this content and works locally</p>
  
  <pre><code>{
  "name" : "emeraldjava/bhaa_wordpress_plugin",
  "description" : "bhaa_wordpress_plugin",
  "type" : "wordpress-plugin",
  "require": {
      "scribu/scb-framework": "dev-master",
      "scribu/lib-posts-to-posts": "dev-master",
      "mustache/mustache": "2.12.0",
      "league/csv": "^9.1",
      "michelf/php-markdown": "^1.8"
  },
  </code></pre>
  
  <p>and my github-actions <a href="https://github.com/emeraldjava/bhaa_wordpress_plugin/blob/master/.github/workflows/build.yml" rel="nofollow noreferrer">build.yml</a> file uses '<a href="https://github.com/MilesChou/composer-action" rel="nofollow noreferrer">MilesChou/composer-action</a>' to install the composer env in the docker container</p>
  
  <pre><code>jobs:
  build:
  
  runs-on: ubuntu-latest
  
  steps:
    - name: Checkout
      uses: actions/checkout@v1
    - name: Composer install
      uses: MilesChou/composer-action/7.3@master
      with:
        args: install --no-dev
    - uses: docker://php:7.3-alpine
    - uses: docker://alpine/git:latest
  </code></pre>
  
  <p>From the build log, I can see that the zip files for these composer artifacts have been downloaded to the cache</p>
  
  <pre><code>36/38:  https://codeload.github.com/scribu/wp-scb-framework/legacy.zip/95b23ac342fce16bf5eb8d939ac5a361b94b104b
  37/38:  https://codeload.github.com/sebastianbergmann/phpunit/legacy.zip/a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9
  38/38:  https://codeload.github.com/scribu/wp-lib-posts-to-posts/legacy.zip/a695438e455587fa228e993d05b4431cde99af1b
  Finished: success: 38, skipped: 0, failure: 0, total: 38
  </code></pre>
  
  <p>The build then failed with this 'sh: git: not found' error</p>
  
  <pre><code>Package operations: 5 installs, 0 updates, 0 removals
  - Installing scribu/scb-framework (dev-master 95b23ac): Cloning 95b23ac342
      Failed to download scribu/scb-framework from source: Failed to clone https://github.com/scribu/wp-scb-framework.git, git was not found, check that it is installed and in your PATH env.
  
  sh: git: not found
  
      Now trying to download from dist
  - Installing scribu/scb-framework (dev-master 95b23ac): Loading from cache
  - Installing scribu/lib-posts-to-posts (dev-master a695438): Cloning a695438e45
      Failed to download scribu/lib-posts-to-posts from source: Failed to clone https://github.com/scribu/wp-lib-posts-to-posts.git, git was not found, check that it is installed and in your PATH env.
  
  sh: git: not found
  
      Now trying to download from dist
  - Installing scribu/lib-posts-to-posts (dev-master a695438): Loading from cache
  - Installing mustache/mustache (v2.12.0): Loading from cache
  - Installing michelf/php-markdown (1.8.0): Loading from cache
  - Installing league/csv (9.4.1): Loading from cache
  </code></pre>
  
  <p>I'm assuming i need to ensure the docker container had git installed, but it seems odd that composer can access the legacy.zip file, so why it git needed at this stage?</p>
  
  <h2>EDIT 1</h2>
  
  <p>I guess the quick fix here is a duplicate of <a href="https://stackoverflow.com/questions/17792588/composer-says-git-not-found?rq=1">this issue</a>, and as the answer below states. </p>
  
  <p>For the sake of completeness, lets assume i can't call 'composer --prefer-dist' how could i ensure the docker container has git available to it?</p>