I am trying to introduce the default SAST scanner by adding the SAST template in my pipeline. However, this causes the build to run in the SAST scan job. Since the SAST scan is running in the test stage I want to pass the artifact built in the build stage earlier. This would reduce some execution time of my pipeline.
However, I am unable to do this. The documentation alluded to this in the following section :=
If your project requires custom build configurations, it can be preferable to avoid compilation during your SAST execution and instead pass all job artifacts from an earlier stage in the pipeline. **This is the current strategy when requiring a before_script execution to prepare your scan job.**
I am not able to understand how can I leverage the before_script to pass the artifact from build stage to test stage.