diff --git a/index.js b/index.js index e9c65a9..d101422 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ -const core = require('@actions/core'); -const github = require('@actions/github'); -const yaml = require('js-yaml'); -const { z } = require('zod'); + +import { getInput, setFailed } from '@actions/core'; +import github from '@actions/github'; +import { load } from 'js-yaml'; +import { z } from 'zod'; const schema = z.object({ path: z.string(), @@ -13,7 +14,7 @@ const schema = z.object({ }); function main() { - const args = yaml.load(core.getInput('args')); + const args = load(getInput('args')); const argObjs = [] for (const arg of args) { argObjs.push(schema.parse(arg)); @@ -24,7 +25,7 @@ function main() { try { main(); } catch (error) { - core.setFailed(error.message); + setFailed(error.message); } // try { diff --git a/package.json b/package.json index e04cbee..6e46249 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "docker-build", + "type": "module", "version": "1.0.0", "description": "", "main": "index.js",