chore(actions): get right version

This commit is contained in:
lisonge 2023-11-05 19:08:52 +08:00
parent cfd052ade9
commit b6da338373
2 changed files with 7 additions and 1 deletions

View File

@ -24,7 +24,7 @@ jobs:
- id: version
run: |
version=$(pnpm show @gkd-kit/subscription version)
version=$(pnpm exec tsx ./scripts/showVersion.ts)
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Git commit

6
scripts/showVersion.ts Normal file
View File

@ -0,0 +1,6 @@
import fs from 'node:fs/promises';
import type PkgT from '../package.json';
const pkg: typeof PkgT = JSON.parse(
await fs.readFile(process.cwd() + '/package.json', 'utf-8'),
);
process.stdout.write(pkg.version);