I have created CI pipeline in gitlab for r-package. I need to capture the lint output and fails the job if there is any lint error. I'm unable to read the output of lintr command.
image: r-base:4.1.2
stages:
- LintR
LintR:
stage: LintR
script:
- cd ..
- R -e "capture.output(lintr::lint_package(\"./test-r/\"), file=\"./lint_output.txt\")"
- cd isp-r && mv ../lint_output.txt .
artifacts:
paths:
- ./lint_output.txt
when: always
How to capture the output in gitlab CI/CD