title: Unable to build latest commit that pushed by pipeline during build using gitlab pipeline
body: <p>I have a pipeline to bump <code>package.json</code> version, build angular, and release it.</p>
  <p>In the <code>bump</code> job I successfully increased my package version and push it into the master
  in the next job which is <code>build</code>, the pipeline didn't pull the newest version, and doing build on the last one that I started the pipeline.</p>
  <p>The question is, How can I pull the last commit that pushed by pipeline in the <code>build</code> job?</p>
  <p>I have this pipeline:</p>
  <pre class="lang-yaml prettyprint-override"><code>stages:
    - bump
    - build
    - release
  
  bump:
   stage: bump
   image:
      entrypoint: ['']
      name: registry.gitlab.com/orgs/registries/node:16
   only:
      - tags
   before_script:
      # Clone the repository via HTTPS inside a new directory
      - git clone &quot;https://$GITLAB_USERNAME:$GITLAB_TOKEN@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git&quot; &quot;${CI_COMMIT_SHA}&quot;
  
      # Set the displayed user with the commits that are about to be made
      - git config --global user.email &quot;${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}&quot;
      - git config --global user.name &quot;${GIT_USER_NAME:-$GITLAB_USER_NAME}&quot;
   script:
      - cd &quot;${CI_COMMIT_SHA}/path/to/angular/&quot;
      - npm version from-git
      - git push origin &quot;${CI_DEFAULT_BRANCH}&quot; -o ci.skip
  
  
  
  build:
    stage: build
    image: registry.gitlab.com/orgs/registries/php:7.4.29
    only:
      - tags
    before_script:
      - echo $CI_JOB_ID
      # Writing GE_JOB_ID variable to environment file, will need the value in the next stage.
      - echo GE_JOB_ID=$CI_JOB_ID &gt;&gt; build.env
      - npm install -g @angular/cli
      - npm install -g nx
      - composer install
    script:
      - cd public/src/frontend/
      - npm install --force
      - echo &quot;Building Angular app and Making Plugin&quot;
      - npm run build:all
      - echo &quot;Build finished&quot;
      - echo &quot;Angular Files&quot;
      - ls -lah
      - cd ../../../
      - echo &quot;Plugin Files&quot;
      - ls -lah
    artifacts:
      paths:
        - release/file.zip
      reports:
        dotenv: build.env
  
    tags:
      - docker
      - gce
  
  release:
    stage: release
    image: registry.gitlab.com/gitlab-org/release-cli:latest
    script:
      - echo 'running release_job'
      - echo 'Previous Job ID is printed below'
      - echo $GE_JOB_ID
    needs:
      - job: build
        artifacts: true
    release:
      name: 'Release File $CI_COMMIT_TAG'
      description: 'Created using the release-cli'
      # tag_name is a mendatory field and can not be an empty string
      tag_name: '$CI_COMMIT_TAG'
      ref: '$CI_COMMIT_TAG'
      assets:
        links:
          - name: 'Artifact'
            url: 'https://gitlab.com/orgs/somerepo/-/jobs/${GE_JOB_ID}/artifacts/raw/release/file.zip'
    only:
      - tags
  </code></pre>