title: Get latest git tags on Gitlab CI/CD pipeline
body: <p>I want to set up a CI/CD pipelines in Gitlab that can read the latest tag and get that last tag to increment my next version application. I came with this configuration:</p>
  
  <pre><code>stages:
    - version
  
  calculate_version:
    image:
      name: alpine/git:latest
      entrypoint: [""]
    stage: version
    script:
      - VERSION=$(git tag);test -z "$VERSION" &amp;&amp; echo "no version tag found" &amp;&amp; exit 1
      - CMDLINE="$VERSION";
      - echo $VERSION
      - echo $CMDLINE &gt; cmdline
    artifacts:
      paths:
        - cmdline
  </code></pre>
  
  <p>But i get no tags listed there on $VERSION. Its look like Gitlab not passing the tags on the repository. However if I create and push a new tag, it shows just that new tag, not all tag list I expected.</p>
  
  <p>Is this the behaviour of the GitLab ci/cd? If yes, how can I get all of the tags in my repo inside the pipeline?</p>