title: Gitlab cross-project artifact
body: <p>I have 2 separate gitlab projects, I've looked through the documentation for 2 days now but am still struggling to achieve what I'm trying for.</p>
  
  <p>I have Project A, which generates the documentation for the whole project.</p>
  
  <p>Project B is a Gitlab Pages project.</p>
  
  <p>My <code>gitlab-ci.yml</code> file for Project A has a job like this</p>
  
  <pre><code>build_docs:
    stage: deploy
    artifacts:
      # Create Archive with name of [Current Job - Current Tag]
      name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
      paths:
        - documentation/build/dokka/
    script:
      - ./gradlew assemble
      - ls $CI_PROJECT_DIR/documentation/build
      - echo "Job Name = $CI_JOB_NAME"
      - echo "Project Dir = $CI_PROJECT_DIR"
      - echo "Docs trigger key = $DOCS_TRIGGER_KEY"
      - echo "Test Unprotected Unmasked Trigger = $TEST_TRIGGER"
      - echo "Job Token = $CI_JOB_TOKEN"
      - echo "Job ID= $CI_JOB_ID"
      - echo "Triggering [Documentation Pipeline]; Artifact from ACL -&gt; Documentation"
      - "curl -X POST -F token=${CI_JOB_TOKEN} -F ref=master https://gitlab.duethealth.com/api/v4/projects/538/trigger/pipeline"
  </code></pre>
  
  <p>This job triggers the following job in Project B:</p>
  
  <pre><code>get-artifacts:
    stage: get-artifacts
    script:
      - echo "I have been triggered!!"
      - echo "$CI_JOB_TOKEN"
      - echo "$CI_JOB_NAME"
      - echo "$CI_PROJECT_DIR"
      - ls $CI_PROJECT_DIR
      # List artifacts generated from acl project
      - 'curl --globoff --header "PRIVATE-TOKEN: abc1234" "https://gitlab.duethealth.com/api/v4/projects/492/jobs"'
      # This should take artifacts from ACL and output them into --output filename
      - 'curl --location --output artifacts.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.duethealth.com/api/v4/android-projects/492/jobs/63426/artifacts"'
      # - unzip build_docs-feature-inf-297-upload-kdoc-doc-mod-test.zip
      - ls $CI_PROJECT_DIR
      - file $CI_PROJECT_DIR/artifacts.zip
      - ls
      only:
        variables:
          - $CI_PIPELINE_SOURCE == "pipeline"
    tags:
      - pages
  </code></pre>
  
  <p>Now, in the job logs of project A. The Artifacts are uploaded successfully and I see a size of ~50000</p>
  
  <p>In the logs of project B, after 
  <code># List artifacts generated from acl project</code>
  I DO see the zip file artifact</p>
  
  <p>However it seems that my curl request to GET a jobs artifacts in incorrect somehow. If you look at the picture below you can see 2 things.</p>
  
  <p>1.) The request size is much small than the upload. So we are uploading artifacts of size ~50000 but then we download those same artifacts at a size of ~1000</p>
  
  <p>2.) The <code>zip</code> file the artifacts should be outputted is not a <code>zip</code> file even though it has the <code>.zip</code> file extension.</p>
  
  <p>It seems to me like it is never actually fetching the artifacts and instead just creating some object named <code>artifacts.zip</code> which is not even a <code>zip</code> file and I'm assuming the file size I'm seeing is just the size of the empty <code>artifacts.zip</code>.</p>
  
  <p>Any insight would be greatly appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/NZoSN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NZoSN.png" alt="JobLog"></a></p>