-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.mjs
More file actions
31 lines (26 loc) · 826 Bytes
/
index.mjs
File metadata and controls
31 lines (26 loc) · 826 Bytes
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
import { getInput, setFailed } from "@actions/core";
import github from "@actions/github";
import { Context } from "@template-tools/template-sync";
import GithubProvider from "github-repository-provider";
async function execute(payload) {
const options = {};
const provider = GithubProvider.initialize(undefined, process.env);
console.log(provider);
const context = await Context.from(
provider,
payload.repository.html_url,
options
);
for await (const pr of context.execute()) {
console.log(pr);
}
}
try {
const template = getInput("template");
console.log(`Hello ${template}`);
//const payload = JSON.stringify(github.context.payload, undefined, 2);
//console.log(`The event payload: ${payload}`);
execute(github.context.payload);
} catch (error) {
setFailed(error.message);
}