Skip to content

GitLab CI/CD ​

The gitlab-ci target sets GitLab CI/CD variables with glab variable set. If the variable already exists, set fails and fnox runs glab variable update instead.

Config typegitlab-ci
Requiresglab, logged in with glab auth login as a maintainer of the project or group
Readable afterwardsYes, by maintainers in the project's CI/CD settings

Quick start ​

toml
[targets.gitlab-prod]
type = "gitlab-ci"
repo = "acme/api"
environment = "production"
masked = true
protected = true

[secrets]
DEPLOY_TOKEN = { provider = "age", value = "YWdl...", push = ["gitlab-prod"] }

Without repo or group, glab uses the project of the current directory.

Configuration ​

FieldDefaultDescription
repocurrent projectProject as group/name.
groupnoneGroup to set the variable in, instead of a project. Conflicts with repo.
environmentall environmentsEnvironment scope of a project variable.
maskedGitLab's defaultHide the value in job logs. GitLab rejects values it cannot mask.
protectedGitLab's defaultExpose the variable only to protected branches and tags.
rawGitLab's defaultDo not expand $ references in the value.
variable_type"env_var""env_var" for the value itself, "file" for the path of a file holding it.
descriptionnoneDescription shown in GitLab.

masked, protected, and raw are passed only when set, so on an update an unset field keeps its current value in GitLab.

Notes ​

  • A failed push shows the errors from both set and update, since fnox cannot tell "already exists" from other failures.
MIT LicenseCopyright © 2026jdx.dev