-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1212d13
commit e5907c2
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import {execSync} from 'child_process'; | |
import fs from 'fs'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
import type {PackageJson} from 'type-fest'; | ||
import getPreviousVersion from '@github/actions/javascript/getPreviousVersion/getPreviousVersion'; | ||
import CONST from '@github/libs/CONST'; | ||
import GitUtils from '@github/libs/GitUtils'; | ||
|
@@ -49,8 +50,14 @@ function setupGitAsOSBotify() { | |
exec('git config --local user.email [email protected]'); | ||
} | ||
|
||
function getVersion() { | ||
return JSON.parse(fs.readFileSync('package.json', {encoding: 'utf-8'})).version as string; | ||
function getVersion(): string { | ||
const packageJson = JSON.parse(fs.readFileSync('package.json', {encoding: 'utf-8'})) as PackageJson; | ||
|
||
if (!packageJson.version) { | ||
throw new Error('package.json does not contain a version field'); | ||
} | ||
|
||
return packageJson.version; | ||
} | ||
|
||
function initGitServer() { | ||
|