Skip to content

Commit

Permalink
require -> import
Browse files Browse the repository at this point in the history
  • Loading branch information
kengo-k committed Jun 1, 2024
1 parent 8a3742e commit d2e2f15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -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(),
Expand All @@ -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));
Expand All @@ -24,7 +25,7 @@ function main() {
try {
main();
} catch (error) {
core.setFailed(error.message);
setFailed(error.message);
}

// try {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "docker-build",
"type": "module",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down

0 comments on commit d2e2f15

Please sign in to comment.