I am trying to include the default gitlab templates for SAST and secret detection into my .gitlab-ci.yml using include template as stated in the documentation (like here). Unfortunately my pipeline definition already contains a before_script section under default which logs into docker registry. Is there any possibility to tell the include to use an empty before_script or to add some tags (in order to assgin shared runners using tags)?
Yes you can, my code was just an example. Don’t forget to check from time to time for any changes to the SAST template that may require some changes in your overrides.
This job was created because it was unable to assign tag in template configuration, in ‘include’ section.
So, I created another job, which stores the sast jobs config.
In my case, it was required to perform this tests in all branches, except test and prod. So when I added rules in include section(to prevent running sast job on specific branched), error appeared: ‘Sast job need script or trigger keywoard’. So I added script keywoard, but made this job hidded for all branches.
The only functional of my ‘sast’ job - create configuration for checks, described in ‘Security/SAST.gitlab-ci.yml’