11import { spawnSync } from 'child_process'
22import fs from 'fs'
33import path from 'path'
4+ import core from '@actions/core'
5+ import github from '@actions/github'
6+ import { Octokit } from '@octokit/rest'
47
58export function runCommand ( commands : string [ ] , cwd ?: string ) {
69 return spawnSync ( commands [ 0 ] , commands . slice ( 1 ) , {
@@ -45,7 +48,6 @@ export async function buildSite() {
4548 // Bypass Jekyll
4649 runCommand ( [ 'touch' , '.nojekyll' ] , workSpace )
4750
48- const core = await import ( '@actions/core' )
4951 const storageType = core . getInput ( 'storageType' )
5052 if ( storageType === 'files' ) process . env . NEXT_PUBLIC_STORAGE = 'files'
5153
@@ -61,9 +63,6 @@ export async function setup() {
6163 console . log ( 'Action: ' , process . env [ 'GITHUB_ACTION' ] )
6264 const workSpace = getWorkspacePath ( )
6365 if ( workSpace ) {
64- const core = await import ( '@actions/core' )
65- const github = await import ( '@actions/github' )
66- const { Octokit } = await import ( '@octokit/rest' )
6766 const user = process . env [ 'GITHUB_ACTOR' ]
6867 const token = core . getInput ( 'token' , { required : true } )
6968 const branch = core . getInput ( 'branch' , { required : true } )
@@ -112,8 +111,6 @@ export async function setup() {
112111export async function publish ( ) {
113112 const workSpace = getWorkspacePath ( )
114113 if ( workSpace ) {
115- const core = await import ( '@actions/core' )
116- const github = await import ( '@actions/github' )
117114 const branch = core . getInput ( 'branch' , { required : true } )
118115 const token = core . getInput ( 'token' , { required : true } )
119116 const user = process . env [ 'GITHUB_ACTOR' ]
0 commit comments