Skip to content

Commit 9e22eac

Browse files
committed
fix: handle undefined GITHUB_WORKSPACE in version file path
1 parent f32f02b commit 9e22eac

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function resolveVersionInput() {
119119
core.warning('Both version and version-file inputs are specified, only version will be used');
120120
}
121121
if (versionFileInput) {
122-
const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFileInput);
122+
const versionFilePath = path.join(process.env.GITHUB_WORKSPACE ?? '', versionFileInput);
123123
if (!fs.existsSync(versionFilePath)) {
124124
throw new Error(`The specified v version file at: ${versionFilePath} does not exist`);
125125
}

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function resolveVersionInput(): string {
102102

103103
if (versionFileInput) {
104104
const versionFilePath = path.join(
105-
process.env.GITHUB_WORKSPACE!,
105+
process.env.GITHUB_WORKSPACE ?? '',
106106
versionFileInput
107107
)
108108
if (!fs.existsSync(versionFilePath)) {

0 commit comments

Comments
 (0)