generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
27 lines (21 loc) · 920 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
const core = require('@actions/core');
const { Octokit } = require("@octokit/action");
const octokit = new Octokit();
const { generateReadmeFromConfig } = require('./generate-github-skills-readme-from-lab-config');
async function run() {
try {
const configPath = core.getInput('config-file');
const courseDetailsPath = core.getInput('course-details-file');
const readmePath = core.getInput('readme-file');
const rootPath = core.getInput('root-path');
const inlineMDlinks = core.getBooleanInput('inline-markdown-links');
core.info(`Generating in ${rootPath}: ${readmePath} from ${configPath}, ${courseDetailsPath} ...`);
const readmeContent = await generateReadmeFromConfig(configPath, courseDetailsPath, readmePath, rootPath, octokit, core, {
inlineMDlinks
});
core.setOutput('readme', readmeContent);
} catch (error) {
core.setFailed(error.message);
}
}
run();