-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (23 loc) · 657 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
"use strict";
const { promises: fs } = require("fs");
const core = require("@actions/core");
const githubLabelSync = require("github-label-sync");
void (async function () {
try {
const labelsFilePath = core.getInput("labels-path");
const content = await fs.readFile(labelsFilePath, "utf8");
const labels = JSON.parse(content);
await githubLabelSync({
accessToken: core.getInput("github-token"),
repo: process.env.GITHUB_REPOSITORY,
allowAddedLabels: true,
labels,
log: {
info: core.info,
warn: core.warning,
},
});
} catch (error) {
core.setFailed(error.message);
}
})();