🚀 add action package

This commit is contained in:
platane
2020-07-19 17:31:43 +02:00
parent 7c240b219b
commit 5d8cc80d2c
3 changed files with 90 additions and 0 deletions

19
packages/action/index.ts Normal file
View File

@@ -0,0 +1,19 @@
import * as fs from "fs";
import * as core from "@actions/core";
import { generateContributionSnake } from "./generateContributionSnake";
(async () => {
try {
console.log(core.getInput("user_name"));
console.log(core.getInput("gif_out_path"));
console.log("--");
console.log(process.cwd());
console.log("--");
console.log(fs.readdirSync(process.cwd()));
const buffer = await generateContributionSnake(core.getInput("user_name"));
fs.writeFileSync(core.getInput("gif_out_path"), buffer);
} catch (e) {
core.setFailed(`Action failed with "${e.message}"`);
}
})();