This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
142 lines (110 loc) · 4.44 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// import programme functions
import collectProgrammesData from "./scripts/programme/collectProgrammesData";
import collectProgrammeData from "./scripts/programme/collectProgrammeData";
// import dsa functions
import collectAllDsaData from "./scripts/dsa/collectAllDsaData";
import collectDsaData from "./scripts/dsa/collectDsaData";
// import blog functions
import collectAllBlogsData from "./scripts/blog/collectAllBlogsData";
import collectBlogData from "./scripts/blog/collectBlogData";
// import programme tags functions
import collectProgrammeTagsData from "./scripts/programme/tag/collectProgrammeTagsData";
import collectProgrammeTagData from "./scripts/programme/tag/collectProgrammeTagData";
// import blog tags functions
import collectBlogTagsData from "./scripts/blog/tag/collectBlogTagsData";
import collectBlogTagData from "./scripts/blog/tag/collectBlogTagData";
// import stats functions
import collectOrgStats from "./scripts/stats/collectOrgStats";
// import humans functions
import generateHumansFn from "./scripts/humans/generateHumans";
// import project functions
import collectProjectsData from "./scripts/home/collectProjectData";
const core = require("@actions/core");
// main function
(async () => {
try {
console.log("Hii there !!!");
// default data
const owner = await core.getInput("owner");
const token = await core.getInput("token");
const PAT = await core.getInput("PAT");
// programme data
const programmeRepo = await core.getInput("programme-repo");
const programmeBranch = await core.getInput("programme-branch");
const collectProgramme = await core.getInput("collect-programme");
const processProgramme = await core.getInput("process-programme");
// dsa data
const dsaRepo = await core.getInput("dsa-repo");
const dsaBranch = await core.getInput("dsa-branch");
const collectDsa = await core.getInput("collect-dsa");
const processDsa = await core.getInput("process-dsa");
// blog data
const blogRepo = await core.getInput("blog-repo");
const blogBranch = await core.getInput("blog-branch");
const collectBlog = await core.getInput("collect-blog");
const processBlog = await core.getInput("process-blog");
// Programme tag data
const collectProgrammeTag = await core.getInput("collect-programme-tag");
const processProgrammeTag = await core.getInput("process-programme-tag");
// Blog tag data
const collectBlogTag = await core.getInput("collect-blog-tag");
const processBlogTag = await core.getInput("process-blog-tag");
// stats data
const collectStats = await core.getInput("collect-stats");
// humans data
const generateHumans = await core.getInput("generate-humans");
// home data
const projectTopic = await core.getInput("project-topic");
const collectProject = await core.getInput("collect-project");
// programme conditions
if (collectProgramme === "true") {
await collectProgrammesData(owner, token, programmeRepo, programmeBranch);
}
if (processProgramme === "true") {
await collectProgrammeData(owner, token, programmeRepo, programmeBranch);
}
// dsa conditions
if (collectDsa === "true") {
await collectAllDsaData(owner, token, dsaRepo, dsaBranch);
}
if (processDsa === "true") {
await collectDsaData(owner, token, dsaRepo, dsaBranch);
}
// blog conditions
if (collectBlog === "true") {
await collectAllBlogsData(owner, token, blogRepo, blogBranch);
}
if (processBlog === "true") {
await collectBlogData(owner, token, blogRepo, blogBranch);
}
// Programme tag conditions
if (collectProgrammeTag === "true") {
await collectProgrammeTagsData(owner, token);
}
if (processProgrammeTag === "true") {
await collectProgrammeTagData(owner, token);
}
// Blog tag conditions
if (collectBlogTag === "true") {
await collectBlogTagsData(owner, token);
}
if (processBlogTag === "true") {
await collectBlogTagData(owner, token);
}
// stats conditions
if (collectStats === "true") {
await collectOrgStats(owner, token);
}
// humans conditions
if (generateHumans === "true") {
await generateHumansFn(owner, token, PAT);
}
// project conditions
if (collectProject === "true") {
await collectProjectsData(owner, token, projectTopic);
}
// end of action
} catch (e) {
core.setFailed(`Action failed with "${e.message}"`);
}
})();