Skip to content

Commit fc49c79

Browse files
committed
fix: clean up paths and id logic
1 parent e3fd2cc commit fc49c79

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/workflows/crowdin-ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,16 @@ jobs:
4444
# Build translations
4545
- name: Build Crowdin project
4646
id: build-crowdin
47-
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/triggerBuild.ts
48-
49-
- name: Load buildId
50-
run: echo "BUILD_ID=$(cat output.env | grep buildId | cut -d'=' -f2)" >> $GITHUB_ENV
47+
run: |
48+
npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/triggerBuild.ts;
49+
grep BUILD_ID output.env >> $GITHUB_ENV;
5150
5251
- name: Await latest build to finish
5352
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/awaitLatestBuild.ts
5453

5554
- name: Check build success
5655
run: |
57-
if [ "$(grep BUILD_SUCCESS output.env | cut -d'=' -f2)" = "false" ]; then
56+
if [ $(grep BUILD_SUCCESS output.env | cut -d'=' -f2) = false ]; then
5857
echo "Build timed out, exiting"
5958
exit 1
6059
fi
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { resolve } from "path"
1+
import { join } from "path"
22

33
export const DOT_CROWDIN = ".crowdin"
44

55
export const CROWDIN_DATA_DIR = "src/data/crowdin"
66
export const SAVE_FILE = "download.zip"
7-
export const FILE_PATH = resolve(CROWDIN_DATA_DIR, SAVE_FILE)
7+
export const FILE_PATH = join(CROWDIN_DATA_DIR, SAVE_FILE)
88

99
export const SUMMARY_SAVE_FILE = "import-summary.json"
10-
export const SUMMARY_PATH = resolve(CROWDIN_DATA_DIR, SUMMARY_SAVE_FILE)
10+
export const SUMMARY_PATH = join(CROWDIN_DATA_DIR, SUMMARY_SAVE_FILE)
1111

1212
export const BUCKETS_IMPORTED_FILE = "buckets-imported.json"
13-
export const BUCKETS_PATH = resolve(CROWDIN_DATA_DIR, BUCKETS_IMPORTED_FILE)
13+
export const BUCKETS_PATH = join(CROWDIN_DATA_DIR, BUCKETS_IMPORTED_FILE)
1414

1515
export const APPROVAL_THRESHOLD = 100

src/scripts/crowdin/translations/triggerBuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function triggerBuild() {
1616
`Build ${isAlreadyFinished ? "already finished" : "triggered"} id:`,
1717
id
1818
)
19-
writeFileSync(OUTPUT_PATH, `buildId=${id}\n`, { flag: "a" })
19+
writeFileSync(OUTPUT_PATH, `BUILD_ID=${id}\n`, { flag: "a" })
2020
} catch (error: unknown) {
2121
console.error((error as Error).message)
2222
}

0 commit comments

Comments
 (0)