forked from dmmikkel/lokalise-key-push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (38 loc) · 1.11 KB
/
index.js
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
const path = require('path');
const fs = require('fs');
const core = require('./core');
const ghCore = require('@actions/core');
const { LokaliseApi } = require('@lokalise/node-api');
const apiKey = ghCore.getInput('api-token');
const projectId = ghCore.getInput('project-id');
const directory = ghCore.getInput('directory');
const format = ghCore.getInput('format');
const platform = ghCore.getInput('platform');
const filename = ghCore.getInput('filename');
const useFilepath = ghCore.getInput('use-filepath');
const ref = ghCore.getInput('ref');
const targetRef = ghCore.getInput('target-ref');
const repository = ghCore.getInput('repository');
const repoToken = ghCore.getInput('repo-token');
core({
apiKey,
projectId,
rawDirectory: directory,
directory: path.join(process.env.GITHUB_WORKSPACE, directory),
format,
platform,
filename,
useFilepath,
ref,
targetRef,
repository,
repoToken
}, {
LokaliseApi,
fs
})
.then((result) => {
ghCore.setOutput('result', JSON.stringify(result));
})
.then(() => console.log('Finished'))
.catch(error => ghCore.setFailed(error ? error.message : 'Unknown error'))