diff --git a/templates/gitlab-ci-golang.yml b/templates/gitlab-ci-golang.yml index 14b9045058649bba24461aa149b07bbd62b2ce50..0ea3a0a5b874e0ae2c70ff1b251920a7ed87b2a0 100644 --- a/templates/gitlab-ci-golang.yml +++ b/templates/gitlab-ci-golang.yml @@ -735,14 +735,13 @@ go-semgrep: stage: test before_script: - *go-scripts - - cd $GO_PROJECT_DIR - - mkdir -p -m 777 reports + - mkdir -p -m 777 ${GO_PROJECT_DIR}/reports - setup_semgrep_rules script: - >- - semgrep ci ${TRACE+--verbose} ${GO_SEMGREP_ARGS} - --gitlab-sast-output=reports/golang-semgrep.gitlab.json - ${DEFECTDOJO_SEMGREP_REPORTS:+--json-output=reports/golang-semgrep.native.json} + semgrep ci ${TRACE+--verbose} ${GO_SEMGREP_ARGS} --subdir ${GO_PROJECT_DIR} + --gitlab-sast-output=${GO_PROJECT_DIR}/reports/golang-semgrep.gitlab.json + ${DEFECTDOJO_SEMGREP_REPORTS:+--json-output=${GO_PROJECT_DIR}/reports/golang-semgrep.native.json} artifacts: name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $ĈI_COMMIT_REF_SLUG" when: "always"