You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default to safe push with --merge --ignore-missing
Pushes are now additive by default — they add or update keys on WTI
but never delete. This prevents accidentally obsoleting keys that
were added on WTI but are missing from stale local files.
- Change push_options default to '--merge --ignore-missing'
- Fix api_key description to avoid GitHub Actions parse error
- Add Safe Sync Model and Recommended Workflow sections to README
- Add target file push example and destructive override to EXAMPLES
By default, source files are pushed with `--merge --ignore-missing`:
96
+
97
+
- **`--merge`** — new keys in the file are added to WTI; existing translations are not overwritten.
98
+
- **`--ignore-missing`** — keys present on WTI but absent from the uploaded file are left alone (not obsoleted).
99
+
100
+
This means pushes are **additive** — they can add or update keys, but never delete. Translations done on WTI are never lost by a push.
101
+
102
+
### Why this matters
103
+
104
+
Without these flags, pushing a source file that is missing keys (e.g. because a translator added them on WTI and the developer hasn't pulled yet) would silently obsolete those keys and lose their translations.
105
+
106
+
### Target file uploads
107
+
108
+
Target file push (`upload_translations: true`) uploads translated files alongside source files. Use this with caution: target file uploads **can overwrite translations** done on WTI, because they replace the full translation content. Only enable this if you are sure your local translations are up to date.
109
+
110
+
```yaml
111
+
- uses: webtranslateit/github-action@v1
112
+
with:
113
+
upload_translations: true
114
+
push_options: '--merge --ignore-missing'
115
+
env:
116
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117
+
```
118
+
119
+
### Overriding the defaults
120
+
121
+
If you want the old destructive behaviour (keys missing from the file get obsoleted), clear the default flags:
122
+
123
+
```yaml
124
+
- uses: webtranslateit/github-action@v1
125
+
with:
126
+
push_options: ''
127
+
env:
128
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129
+
```
130
+
131
+
## Recommended Workflow
132
+
133
+
1. Developer adds keys and source text (e.g. English) in code, commits, pushes to the default branch.
134
+
2. The action pushes the source file to WTI (safe merge — adds new keys, never deletes).
135
+
3. Translators translate on the WTI web interface.
136
+
4. The action pulls translations back and opens a pull request.
137
+
5. The team merges the PR to get translations into the codebase.
138
+
139
+
Developers can run `wti pull` locally to preview translations during development, but should never run `wti push` — the action is the sole writer to WTI.
140
+
95
141
## Advanced Examples
96
142
97
143
See [docs/EXAMPLES.md](docs/EXAMPLES.md) for more workflow recipes:
Copy file name to clipboardExpand all lines: docs/EXAMPLES.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,15 +77,28 @@ jobs:
77
77
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78
78
```
79
79
80
-
## Push with merge + ignore missing (safe update)
80
+
## Destructive push (override safe defaults)
81
81
82
-
Avoid obsoleting keys that are missing from the uploaded file and mark changes as minor.
82
+
By default the action pushes with `--merge --ignore-missing` so keys on WTI are never accidentally obsoleted. If you need the old destructive behaviour, clear the default flags:
83
83
84
84
```yaml
85
85
- uses: webtranslateit/github-action@v1
86
86
with:
87
87
api_key: ${{ secrets.WTI_API_KEY }}
88
-
push_options: '--merge --ignore-missing --minor'
88
+
push_options: ''
89
+
```
90
+
91
+
## Push target files (translations)
92
+
93
+
Upload translated files alongside source files. Use with caution — target file uploads can overwrite translations done on WTI.
0 commit comments