File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/scripts/crowdin/translations Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
import crowdin from "../api-client/crowdinClient"
2
2
3
- import "dotenv/config"
4
-
5
3
async function triggerBuild ( ) {
6
4
const projectId = Number ( process . env . CROWDIN_PROJECT_ID ) || 363359
7
5
8
6
try {
9
- await crowdin . translationsApi . buildProject ( projectId , {
10
- exportApprovedOnly : true ,
11
- } )
7
+ const response = await crowdin . translationsApi . buildProject ( projectId )
8
+ const { id, status } = response . data
9
+ const isAlreadyFinished = status === "finished"
10
+ console . log (
11
+ `Build ${ isAlreadyFinished ? "already finished" : "triggered" } id:` ,
12
+ id
13
+ )
14
+ console . log ( `::set-output name=buildId::${ id } ` )
12
15
} catch ( error : unknown ) {
13
16
console . error ( ( error as Error ) . message )
14
17
}
You can’t perform that action at this time.
0 commit comments