Skip to content

Commit fb5302f

Browse files
committed
fixup file path helper for ES modules
1 parent b76b78d commit fb5302f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as core from '@actions/core'
22
import * as github from '@actions/github'
33
import * as path from 'path'
4+
import { fileURLToPath } from 'url'
45
import { OpenAI } from 'openai'
56
import { evaluateContent } from './prompt.js'
67
import { addLabels, minimizeComment } from './github.js'
@@ -12,6 +13,8 @@ async function run(): Promise<void> {
1213
// 0. Inputs & setup
1314
//------------------------------------------------------------
1415
const token = core.getInput('token')
16+
const __filename = fileURLToPath(import.meta.url)
17+
const __dirname = path.dirname(__filename)
1518
const promptsDir = path.resolve(__dirname, '..', 'prompts') // Use built-in prompts
1619
const spamLabel = core.getInput('spam-label')
1720
const aiLabel = core.getInput('ai-label')

0 commit comments

Comments
 (0)