Set up CodeAnt Quality Gates in your GitLab CI Pipeline.
.gitlab-ci.yml
. It will trigger on every push to your repository and run quality gate checks to detect secrets and other security issues:
Important:
- In Settings → CI/CD → Variables, add a protected and masked variable named
ACCESS_TOKEN
with your GitLab Personal Access Token or project access token.- The quality gate will fail your pipeline if secrets are detected in the changed code.
quality_gates.sh
) from the CodeAnt API endpoint.
-o start
operation.
-o results
operation with:
quality_gates.sh
script accepts the following parameters:
Parameter | Description | Required | Example |
---|---|---|---|
-a, --access-token | GitLab Personal Access Token or project token | Yes | $ACCESS_TOKEN |
-r, --repo | Project path in format group/project | Yes | $CI_PROJECT_PATH |
-c, --commit-id | Commit SHA to scan | Yes | $CI_COMMIT_SHA |
-s, --service | VCS provider | Yes | gitlab |
-o, --operation | Operation to perform (start or results ) | Yes | start or results |
-t, --timeout | Timeout in seconds for polling (default: 300) | No | 300 |
-p, --poll-interval | Poll interval in seconds (default: 15) | No | 15 |
-u, --base-url | Base URL for GitLab instance (optional) | No | https://gitlab.com |
ACCESS_TOKEN
as both protected and masked-t 600
(10 minutes)ACCESS_TOKEN
variable is correctly configured in Settings → CI/CD → Variablesapi
, read_repository
scopes)echo $CI_COMMIT_SHA
group/project
)curl
is available in your image (install with apt-get install -y curl
)