From 162799372778a471fdcdaa5bf3b52c0407db858d Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Wed, 25 Sep 2024 15:45:33 +0200 Subject: [PATCH] use toolkit component for ensure-job-added --- .gitlab-ci.yml | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb0263a..a3b148a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,23 +3,12 @@ include: inputs: run_advanced_sast: true -stages: [test, release] + - component: $CI_SERVER_FQDN/components/toolkit/ensure-job-added@main + inputs: + job_name: gitlab-advanced-sast + exact: true -ensure-job-added: - parallel: - matrix: - - JOB_NAME: - - gitlab-advanced-sast - image: badouralix/curl-jq - script: - - | - route="$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs" - count=`curl --silent $route | jq "map(select(.name | contains(\"$JOB_NAME\"))) | length"` - if [ "$count" != "1" ]; then - exit 1 - fi - rules: - - if: $CI_COMMIT_BRANCH && $CI_SERVER_HOST =~ /gitlab.com/ +stages: [test, release] # Ensure that a project description exists, because it will be important to display # the resource in the catalog.