Skip to main content
On a CI provider without a dedicated guide, three things need attention so Momentic behaves the same as it does on supported providers: CI detection, cache saving, and git metadata.

Detect CI

Set CI=true on custom runners so the CLI uses its CI defaults, including noninteractive behavior and cache writes. Provider-specific Git metadata detection uses the provider’s own environment variables.

Saving caches

By default, Momentic does not write step caches on configured protected branches, including gitMainBranch. CI enables cache writes through the --save-cache option’s environment default. If your runner does not set CI, pass --save-cache explicitly:
Always save caches in CI. See Step cache for how caching works.

Git metadata

Momentic collects Git metadata for cache isolation, run traceability, and integration status posts. It reads metadata via the git CLI or provider-specific handling. If your CI runner doesn’t have git or runs in a shallow state, provide metadata yourself via env vars.
For best cache performance, provide at minimum GIT_BRANCH_NAME, GIT_COMMIT_SHA, GIT_COMMIT_TIMESTAMP, LAST_COMMIT_ON_MAIN_SHA, LAST_COMMIT_ON_MAIN_TIMESTAMP, and if possible MERGED_GIT_BRANCH_NAME.
  • MOMENTIC_GIT_OVERRIDE=true: must be set to enable git metadata overrides
  • GIT_COMMIT_SHA: the full commit SHA
  • GIT_COMMIT_SHA_SHORT: the short commit SHA (if not provided, Momentic derives it from the full SHA)
  • GIT_COMMIT_TIMESTAMP: the current commit timestamp in ISO 8601 format
  • GIT_BRANCH_NAME: the current branch name
  • GIT_ORIGIN_URL: the git origin URL
  • GIT_COMMIT_AUTHOR_NAME: the commit author’s name
  • GIT_COMMIT_MESSAGE: the commit message
  • LAST_COMMIT_ON_MAIN_SHA: the full commit SHA of the last commit on main. When using git, this is the output of running git merge-base main HEAD. On main, this is the current commit SHA.
  • LAST_COMMIT_ON_MAIN_TIMESTAMP: the commit timestamp of LAST_COMMIT_ON_MAIN_SHA in ISO 8601 format.
  • MERGED_GIT_BRANCH_NAME: when on main, the name of the branch that was merged to create the current commit. This is usually derived from pull/merge requests using our GitHub/GitLab integrations.
  • GITHUB_REPOSITORY: the GitHub repository name in the format owner/repo (if applicable)
  • GITLAB_PROJECT_PATH: the GitLab project path in the format group/subgroup/repo (if applicable)
  • GIT_USERNAME: the username of the current git user (if applicable)
  • GIT_EMAIL: the email of the current git user (if applicable)
  • GIT_NAME: the name of the current git user (if applicable)