feat: dynamically import '@actions/core' in runRelease function

This commit is contained in:
2024-10-06 23:28:48 +08:00
parent 0567b9b813
commit ee0a168f6e

View File

@ -2,7 +2,6 @@ import { exec as execCallback } from 'node:child_process';
import { dirname, resolve } from 'node:path'; import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import { promisify } from 'node:util'; import { promisify } from 'node:util';
import core from '@actions/core';
const exec = promisify(execCallback); const exec = promisify(execCallback);
const self_cwd = dirname(fileURLToPath(import.meta.url)); const self_cwd = dirname(fileURLToPath(import.meta.url));
// import packageJson from './package.json' with { type: "json" }; // import packageJson from './package.json' with { type: "json" };
@ -21,6 +20,7 @@ async function installDependencies() {
} }
async function runRelease() { async function runRelease() {
const core = await import('@actions/core');
const semanticRelease = await import('semantic-release'); const semanticRelease = await import('semantic-release');
const result = await semanticRelease.default( const result = await semanticRelease.default(
{ {