GitLab: WARNING: gl-sast-report.json: no matching files

When enabling SAST in a gitlab project you can have that kind of error at the tests part:

The yaml provided is not containing the needed part:

artifacts:
   name: sast
   paths:
     - gl-sast-report.json
   reports:
     sast: gl-sast-report.json
   when: always

Source:

https://forum.gitlab.com/t/uploading-artifacts-warning-gl-sast-report-json-no-matching-files-error-no-files-to-upload/60887/5

https://gitlab.com/gitlab-org/gitlab/-/issues/345696#note_737150614