From 67059baf3bb38b1ecec6145287950e6adc226c42 Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Sat, 7 Jun 2025 16:48:41 +0200 Subject: [PATCH] Import the `GitHub` type from `@actions/github` with file extension syntax This improves the code compatibility with the ESM syntax. Issue #603 --- .eslintrc.json | 1 + src/input-providers/artifact-provider.ts | 2 +- src/main.ts | 2 +- src/utils/github-utils.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 48214c7..2e7e189 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,6 +10,7 @@ "rules": { "i18n-text/no-en": "off", "eslint-comments/no-use": "off", + "import/extensions": [ "error", "ignorePackages", { "ts": "never" } ], "import/no-namespace": "off", "import/no-named-as-default": "off", "no-shadow": "off", diff --git a/src/input-providers/artifact-provider.ts b/src/input-providers/artifact-provider.ts index 740eb93..ed95ebe 100644 --- a/src/input-providers/artifact-provider.ts +++ b/src/input-providers/artifact-provider.ts @@ -1,6 +1,6 @@ import * as core from '@actions/core' import * as github from '@actions/github' -import {GitHub} from '@actions/github/lib/utils' +import type {GitHub} from '@actions/github/lib/utils.js' import Zip from 'adm-zip' import picomatch from 'picomatch' diff --git a/src/main.ts b/src/main.ts index 57137ab..234e5f0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import * as core from '@actions/core' import * as github from '@actions/github' -import {GitHub} from '@actions/github/lib/utils' +import type {GitHub} from '@actions/github/lib/utils.js' import {ArtifactProvider} from './input-providers/artifact-provider' import {LocalFileProvider} from './input-providers/local-file-provider' diff --git a/src/utils/github-utils.ts b/src/utils/github-utils.ts index 19fe921..3b52ff1 100644 --- a/src/utils/github-utils.ts +++ b/src/utils/github-utils.ts @@ -1,7 +1,7 @@ import {createWriteStream} from 'fs' import * as core from '@actions/core' import * as github from '@actions/github' -import {GitHub} from '@actions/github/lib/utils' +import type {GitHub} from '@actions/github/lib/utils.js' import type {PullRequest} from '@octokit/webhooks-types' import * as stream from 'stream' import {promisify} from 'util'