mirror of
https://github.com/gradle/actions.git
synced 2026-03-02 17:49:49 +08:00
Convert project to ESM and update dependencies (#854)
- Switch to esbuild for bundling - Update npm dependency version - Add require header for compat with older JS libs
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import {fileURLToPath} from 'url'
|
||||
|
||||
export function readResourceFileAsString(...paths: string[]): string {
|
||||
// Resolving relative to __dirname will allow node to find the resource at runtime
|
||||
const absolutePath = path.resolve(__dirname, '..', '..', '..', 'sources', 'src', 'resources', ...paths)
|
||||
const moduleDir = path.dirname(fileURLToPath(import.meta.url))
|
||||
const absolutePath = path.resolve(moduleDir, '..', '..', '..', 'sources', 'src', 'resources', ...paths)
|
||||
return fs.readFileSync(absolutePath, 'utf8')
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import * as cache from '@actions/cache'
|
||||
import * as deprecator from './deprecation-collector'
|
||||
import {SUMMARY_ENV_VAR} from '@actions/core/lib/summary'
|
||||
|
||||
import path from 'path'
|
||||
import * as path from 'path'
|
||||
|
||||
const ACTION_ID_VAR = 'GRADLE_ACTION_ID'
|
||||
const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'
|
||||
|
||||
export const ACTION_METADATA_DIR = '.setup-gradle'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user