Skip to main content

kalima-push and kalima-pull

These actions live in this repo:

  • .github/actions/kalima-push
  • .github/actions/kalima-pull

kalima-push

Inputs:

  • project-key (required)
  • sync-secret (required)
  • api-url (optional, default https://api.kalima.digital/api/v1)

Behavior (high level):

  • Discovers translation files under common folders (locales/, i18n/, translations/, and src/* variants)
  • If .locale/config.json exists, it can explicitly map locales to file paths
  • Signs the request with HMAC-SHA256 and sends files to POST /api/sync/push on your Kalima API

kalima-pull

Inputs:

  • project-key (required)
  • sync-secret (required)
  • api-url (optional, default https://api.kalima.digital/api/v1)
  • format (optional, default json)
  • locales (optional, comma-separated)
  • structure (optional, default flat)
  • status (optional, default approved)

Behavior (high level):

  • Signs the request with HMAC-SHA256 and fetches files from GET /api/sync/pull on your Kalima API
  • Writes files into locales/ by default (or .locale/config.json outputDir)
  • If .locale/config.json has paths, it writes each locale to the configured path

Request signing

Both actions send these headers:

  • x-project-key
  • x-sync-ts
  • x-sync-nonce
  • x-sync-signature

The signature payload is:

METHOD
PATH
PROJECT_KEY
TIMESTAMP
NONCE

PATH is the request path without query parameters, for example /api/sync/pull.

.locale/config.json (example)

{
"outputDir": "locales",
"paths": {
"en": "locales/en.json",
"fr": "locales/fr.json"
}
}