Replace this template with your information
Describe your question in as much detail as possible:
I am trying to create a CICD Components but it looks like the type doesn’t work in my case. Despite the “type: boolean” in the components.yaml but the allow_failure
is being rendered as string.
-
Consider including screenshots, error messages, and/or other helpful visuals
-
What version are you on? Are you using self-managed or GitLab.com?
- GitLab (Hint:
/help
): Gitlab.com - Runner (Hint:
/admin/runners
): shared
- GitLab (Hint:
-
Add the CI configuration from
.gitlab-ci.yml
and other configuration if relevant (e.g. docker-compose.yml)
gitlab-ci.yml
include:
- component: gitlab.com/$CI_PROJECT_PATH/docker-component@$CI_COMMIT_SHA
inputs:
stage: test
allowf: true
stages: [test, release]
create-release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /\d+/
script: echo "Creating release $CI_COMMIT_TAG"
release:
tag_name: $CI_COMMIT_TAG
description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH"
/templates/docker-component.yml
spec:
inputs:
stage:
default: test
allowf:
type: boolean
default: false
image:
default: bridgecrew/checkov:2.5.8
---
checkov:
stage: $[[ inputs.stage ]]
allow_failure: $[[ inputs.allowf ]]
variables:
CKV_FRAMEWORK: dockerfile
image:
name: $[[ inputs.image ]]
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
rules:
script:
- checkov --skip-download -d . -o cli -o junitxml --output-file-path console,checkov.xml
artifacts:
reports:
junit: "checkov.xml"
paths:
- "checkov.xml"
Error:
jobs:checkov allow failure should be a hash or a boolean value
rendered ci yaml under “full configuration”
---
checkov:
stage: test
allow_failure: 'true'
variables:
CKV_FRAMEWORK: dockerfile