Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (79 loc) · 3.7 KB
/
Copy pathaction.yml
File metadata and controls
81 lines (79 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: 'locize translate'
description: 'AI-translate your i18next files in CI with locize: extract changed keys, sync, auto-translate, and deliver via the locize CDN.'
author: 'locize'
branding:
icon: 'globe'
color: 'blue'
inputs:
api-key:
description: 'The locize api-key (store it as a repository secret). Any write-capable key works; not needed for command: check. Optional if LOCIZE_API_KEY (or LOCIZE_APIKEY) is set in the environment.'
required: false
project-id:
description: 'The locize project-id. Not needed for command: check. Optional if LOCIZE_PROJECTID (or LOCIZE_PROJECT_ID) is set in the environment.'
required: false
command:
description: 'Which flow to run: "localize" (default; detect → extract → sync → auto-translate → download — instrumentation is always skipped in CI) or "sync" (sync → auto-translate → download, for repos whose locale files are already extracted) or "check" (i18next-cli lint + status as a pull request gate, read-only, no credentials needed; results in the job summary).'
required: false
default: 'localize'
working-directory:
description: 'Directory that contains your i18next.config.{ts,js} (default: repository root).'
required: false
default: '.'
config:
description: 'Path to an i18next config file, overriding automatic detection (relative to working-directory or absolute).'
required: false
cdn-type:
description: 'locize CDN endpoint to use: standard or pro (default: standard).'
required: false
default: 'standard'
update-values:
description: 'Also update existing translation values on locize, not only add new keys (default: false).'
required: false
default: 'false'
changed-only:
description: 'Only sync and auto-translate the keys that changed on this branch vs. the base branch (command: sync only). Defaults to true on pull_request events, false otherwise. Requires actions/checkout with fetch-depth: 0 so the base branch is available.'
required: false
default: ''
skip-translate:
description: 'Sync keys to locize but do not request AI auto-translation (default: false).'
required: false
default: 'false'
dry-run:
description: 'Preview every step without writing or pushing anything (default: false).'
required: false
default: 'false'
cli-version:
description: 'Major version (or dist-tag) of i18next-cli to install (default: 1 — all v1.x fixes/features, no breaking-major surprise). Set to "latest" for the newest release.'
required: false
default: '1'
node-version:
description: 'Node.js version to set up (i18next-cli requires >=22; default: 24).'
required: false
default: '24'
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v7
with:
node-version: ${{ inputs.node-version }}
# inputs reach the shell through env, never interpolated into the script
# (GitHub's hardening guide: an expression in run: is pasted in before bash parses it)
- run: npm i -g "i18next-cli@$CLI_VERSION" locize-cli@12
shell: bash
env:
CLI_VERSION: ${{ inputs.cli-version }}
- run: echo "$GITHUB_ACTION_PATH" >> "$GITHUB_PATH"
shell: bash
- run: run.sh
shell: bash
env:
INPUT_API_KEY: ${{ inputs.api-key }}
INPUT_PROJECT_ID: ${{ inputs.project-id }}
INPUT_COMMAND: ${{ inputs.command }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working-directory }}
INPUT_CONFIG: ${{ inputs.config }}
INPUT_CDN_TYPE: ${{ inputs.cdn-type }}
INPUT_UPDATE_VALUES: ${{ inputs.update-values }}
INPUT_CHANGED_ONLY: ${{ inputs.changed-only }}
INPUT_SKIP_TRANSLATE: ${{ inputs.skip-translate }}
INPUT_DRY_RUN: ${{ inputs.dry-run }}