-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
32 lines (28 loc) · 832 Bytes
/
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
const core = require("@actions/core");
const getAppStats = require("./lib/app-stats");
main();
async function main() {
const appId = core.getInput("id", { required: true });
const privateKey = core
.getInput("private_key", { required: true })
.replace(/\\n/g, "\n");
try {
const {
installations,
repositories,
popularRepositories,
suspendedInstallations,
} = await getAppStats({
appId,
privateKey,
});
core.setOutput("installations", installations);
core.setOutput("repositories", repositories);
core.setOutput("popular_repositories", JSON.stringify(popularRepositories));
core.setOutput("suspended_installations", suspendedInstallations);
console.log("done.");
} catch (error) {
core.error(error);
core.setFailed(error.message);
}
}