Skip to content

Commit b989802

Browse files
committed
Change the way import github actions
1 parent b2f45b2 commit b989802

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

action/repository.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { spawnSync } from 'child_process'
22
import fs from 'fs'
33
import path from 'path'
4+
import core from '@actions/core'
5+
import github from '@actions/github'
6+
import { Octokit } from '@octokit/rest'
47

58
export 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() {
112111
export 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

Comments
 (0)