NixCI automatically provides environment variables during test and deploy jobs.
Every test and deploy job sets CI.
CI
:
true
These variables provide information about the commit and branch being built. They are automatically available in all test and deploy jobs and do not need to be declared.
NIX_CI_GIT_COMMIT_SHA
: The full commit SHA hash (e.g.,
7972a801abc123...
)NIX_CI_GIT_REF
: The full git reference (e.g.,
refs/heads/main
,
refs/tags/v1.0.0
)NIX_CI_GIT_BRANCH
: The short branch or tag name (e.g.,
main
,
v1.0.0
)Test and deploy jobs can also access custom secrets and SSH keys as environment variables. See the Secrets & SSH Keys documentation for how to declare and use them.