forked from lauchacarro/Azure-Storage-Action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
57 lines (46 loc) · 1.36 KB
/
index.js
File metadata and controls
57 lines (46 loc) · 1.36 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
const exec = require('@actions/exec');
const core = require('@actions/core');
const main = async () => {
const connectionString = core.getInput('connection-string');
const folder = core.getInput('folder');
const containerName = core.getInput('blob-container-name');
const accessPolicy = core.getInput('public-access-policy');
const enableStaticWebSite = core.getInput('enabled-static-website');
const indexDoc = core.getInput('index-document');
const errorDoc = core.getInput('error-document');
let args = ['run', '-c', 'Release', '--project', __dirname + '/src/AzureStorageAction/AzureStorageAction.csproj', '--'];
if (connectionString) {
args.push('-c')
args.push(connectionString)
}
if (folder) {
args.push('-f')
args.push(folder)
}
if (containerName) {
args.push('-n')
args.push(containerName)
}
if (accessPolicy) {
args.push('-a')
args.push(accessPolicy)
}
if (enableStaticWebSite) {
args.push('-s')
args.push(enableStaticWebSite)
}
if(indexDoc) {
args.push('-i')
args.push(indexDoc)
}
if(errorDoc) {
args.push('-e')
args.push(errorDoc)
}
await exec.exec('dotnet', args);
};
main().catch(err => {
console.error(err);
console.error(err.stack);
process.exit(-1);
})