diff --git a/src/buildExec.test.ts b/src/buildExec.test.ts index 0508a54..6e4da84 100644 --- a/src/buildExec.test.ts +++ b/src/buildExec.test.ts @@ -1,7 +1,7 @@ import buildExec from './buildExec'; const github = require('@actions/github'); -import VERSION from './version'; +import { version } from './version'; const context = github.context; @@ -15,7 +15,7 @@ test('no arguments', () => { '-F', '', '-Q', - `github-action-${VERSION}`, + `github-action-${version}`, ]; if (context.eventName == 'pull_request') { args.push('-C', `${context.payload.pull_request.head.sha}`); @@ -73,7 +73,7 @@ test('all arguments', () => { '-F', 'test', '-Q', - `github-action-${VERSION}`, + `github-action-${version}`, '-c', '-N', '83231650328f11695dfb754ca0f540516f188d27', diff --git a/src/buildExec.ts b/src/buildExec.ts index edb614f..52e95d8 100644 --- a/src/buildExec.ts +++ b/src/buildExec.ts @@ -1,7 +1,7 @@ const core = require('@actions/core'); const github = require('@actions/github'); -import VERSION from './version'; +import { version } from './version'; const context = github.context; @@ -59,7 +59,7 @@ const buildExec = () => { '-F', `${flags}`, '-Q', - `github-action-${VERSION}`, + `github-action-${version}`, ); const options:any = {}; diff --git a/src/version.ts b/src/version.ts index 1cc1616..a725083 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,3 +1 @@ -const VERSION = 'v1.5.2'; - -export default VERSION; +export { version } from '../package.json'; diff --git a/tsconfig.json b/tsconfig.json index dbe3a5a..831eb89 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,7 @@ { + "compilerOptions": { + "resolveJsonModule": true + }, "include": [ "src" ]