From 4bd6adcccb6645006b045aacc8d2bcca809356a9 Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Fri, 31 Jul 2026 16:35:52 +0900 Subject: [PATCH 1/2] Import example.ts --- example.ts | 1 + index.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 example.ts diff --git a/example.ts b/example.ts new file mode 100644 index 0000000..98c6421 --- /dev/null +++ b/example.ts @@ -0,0 +1 @@ +export const example = () => 'Hello from example.ts!' diff --git a/index.ts b/index.ts index 6355e91..b031eaa 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,6 @@ import type * as core from '@actions/core' import type * as github from '@actions/github' +import { example } from './example.js' type GitHubScriptContext = { core: typeof core @@ -15,7 +16,7 @@ export const main = async ({ core, context, github }: GitHubScriptContext) => { owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - body: 'Hello from TypeScript!' + body: example() }) } } From 708ccc011e055efd003e2577db2e1674b52a5bb0 Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Fri, 31 Jul 2026 16:38:02 +0900 Subject: [PATCH 2/2] allowImportingTsExtensions --- index.ts | 2 +- tsconfig.json | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index b031eaa..5831269 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,6 @@ import type * as core from '@actions/core' import type * as github from '@actions/github' -import { example } from './example.js' +import { example } from './example.ts' type GitHubScriptContext = { core: typeof core diff --git a/tsconfig.json b/tsconfig.json index 4a2e7cd..0c3d15d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,8 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": ["@tsconfig/node24/tsconfig.json"] + "extends": ["@tsconfig/node24/tsconfig.json"], + "compilerOptions": { + "allowImportingTsExtensions": true, + "noEmit": true + } } \ No newline at end of file