'GitLab Container scanning runs without being called
I am currently using the GitLab Security/Container-Scanning.gitlab-ci.yml template to perform container scans. I am using extends: container_scanning in each job I want to run the scan.
include:
- template: Security/Container-Scanning.gitlab-ci.yml
example_container_scan:
extends: container_scanning
When the ci pipeline runs it will kick off the example_container_scan job AND another container_scanning job.
In fact, the container_scanning job will kick off even if it is not mentioned in any job. Simply by importing the template, kicks off.
My question is, how do you disable the extra container_scanning job from running? In other words, I only want the example_container_scan job to run.
Any help would be appreciated!
Solution 1:[1]
Current workaround was to take the Container-Scanning.gitlab-ci.yml, add it to the project repo and making the container_scanning job hidden (.container_scanning).
# include the Container-Scanning.gitlab-ci.yml from the local project
include:
- Security/Container-Scanning.gitlab-ci.yml
example_container_scan:
extends: .container_scanning
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Stacker |
