Files
snk/packages/action/index.ts
platane a9347ab75c aaaa
2020-07-20 09:53:32 +02:00

21 lines
587 B
TypeScript

import * as fs from "fs";
import * as core from "@actions/core";
import { generateContributionSnake } from "./generateContributionSnake";
(async () => {
try {
const userName = core.getInput("github_user_name");
const gifOutPath = core.getInput("gif_out_path");
const buffer = await generateContributionSnake(userName);
console.log({ userName, gifOutPath }, buffer.length);
fs.writeFileSync(gifOutPath, buffer);
console.log(`::set-output name=gif_out_path::${gifOutPath}`);
} catch (e) {
core.setFailed(`Action failed with "${e.message}"`);
}
})();