Pull the package version from package.json

This commit is contained in:
Daniel Kennedy
2026-01-28 22:04:06 -05:00
parent 80a36d9d60
commit 312efa3fe7
@@ -1,9 +1,9 @@
// Version is hardcoded to avoid issues with import.meta.url in Jest
const VERSION = '6.0.0'
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
const packageJson = require('../../../package.json')
/**
* Ensure that this User Agent String is used in all HTTP calls so that we can monitor telemetry between different versions of this package
*/
export function getUserAgentString(): string {
return `@actions/artifact-${VERSION}`
return `@actions/artifact-${packageJson.version}`
}