Skip to content

Pipeline fails if more than one code reporting artifact file should be uploaded

Problem to solve

If using code-checks in a pipeline with reporting artifacts with a file glob, the pipeline fails with the following error:

FATAL: only one file can be send as raw            
ERROR: Job failed: exit code 1

The used configuration looks like this:

  artifacts:
    reports:
      codequality:
        - "repo/php-cs-fixer-report-*.json"
        - "repo/phpstan-report.json"

As you can see, the php-cs-fixer creates multiple php-cs-fixer-report files. According to the gitlab documentation, a "*" can be used to fetch multiple artifact files. However the mentioned error then appears.

Intended users

Developers

Proposal

Either mention that file globs are not possible for multiple reports artifact files, or even better, let gitlab somehow still use the reports even if it is split into multiple files.

Links / references

https://docs.gitlab.com/ee/ci/yaml/#artifactspaths