1- import * as fs from "fs" ;
2- import * as path from "path" ;
3- import * as core from "@actions/core" ;
1+ import * as fs from "node:fs" ;
2+ import * as path from "node:path" ;
43import { parseOutputsOption } from "./outputsOptions" ;
4+ import * as githubAction from "./github-action" ;
55
66( async ( ) => {
77 try {
8- const userName = core . getInput ( "github_user_name" ) ;
9- const outputs = parseOutputsOption (
10- core . getMultilineInput ( "outputs" ) ?? [
11- core . getInput ( "gif_out_path" ) ,
12- core . getInput ( "svg_out_path" ) ,
13- ] ,
14- ) ;
8+ const userName = githubAction . getInput ( "github_user_name" ) ;
9+ const outputsRaw = [
10+ ...githubAction . getInput ( "outputs" ) . split ( "\n" ) ,
11+ //
12+ // legacy
13+ githubAction . getInput ( "gif_out_path" ) ,
14+ githubAction . getInput ( "svg_out_path" ) ,
15+ ]
16+ . map ( ( x ) => x . trim ( ) )
17+ . filter ( Boolean ) ;
18+
19+ const outputs = parseOutputsOption ( outputsRaw ) ;
1520 const githubToken =
16- process . env . GITHUB_TOKEN ?? core . getInput ( "github_token" ) ;
21+ process . env . GITHUB_TOKEN ?? githubAction . getInput ( "github_token" ) ;
1722
1823 const { generateContributionSnake } = await import (
1924 "./generateContributionSnake"
@@ -31,6 +36,6 @@ import { parseOutputsOption } from "./outputsOptions";
3136 }
3237 } ) ;
3338 } catch ( e : any ) {
34- core . setFailed ( `Action failed with "${ e . message } "` ) ;
39+ githubAction . setFailed ( `Action failed with "${ e . message } "` ) ;
3540 }
3641} ) ( ) ;
0 commit comments