File tree Expand file tree Collapse file tree 3 files changed +12
-15
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +12
-15
lines changed
Original file line number Diff line number Diff line change @@ -64546,18 +64546,18 @@ function cacheDependencies(cache, pythonVersion) {
64546
64546
}
64547
64547
function resolveVersionInput() {
64548
64548
let version = core.getInput('python-version');
64549
- const versionFile = core.getInput('python-version-file');
64549
+ let versionFile = core.getInput('python-version-file');
64550
64550
if (version && versionFile) {
64551
64551
core.warning('Both python-version and python-version-file inputs are specified, only python-version will be used');
64552
64552
}
64553
64553
if (version) {
64554
64554
return version;
64555
64555
}
64556
- const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFile || '.python-version') ;
64557
- if (!fs_1.default.existsSync(versionFilePath )) {
64558
- throw new Error(`The specified python version file at: ${versionFilePath } does not exist`);
64556
+ versionFile = versionFile || '.python-version';
64557
+ if (!fs_1.default.existsSync(versionFile )) {
64558
+ throw new Error(`The specified python version file at: ${versionFile } does not exist`);
64559
64559
}
64560
- version = fs_1.default.readFileSync(versionFilePath , 'utf8');
64560
+ version = fs_1.default.readFileSync(versionFile , 'utf8');
64561
64561
core.info(`Resolved ${versionFile} as ${version}`);
64562
64562
return version;
64563
64563
}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
24
24
25
25
function resolveVersionInput ( ) : string {
26
26
let version = core . getInput ( 'python-version' ) ;
27
- const versionFile = core . getInput ( 'python-version-file' ) ;
27
+ let versionFile = core . getInput ( 'python-version-file' ) ;
28
28
29
29
if ( version && versionFile ) {
30
30
core . warning (
@@ -36,16 +36,13 @@ function resolveVersionInput(): string {
36
36
return version ;
37
37
}
38
38
39
- const versionFilePath = path . join (
40
- process . env . GITHUB_WORKSPACE ! ,
41
- versionFile || '.python-version'
42
- ) ;
43
- if ( ! fs . existsSync ( versionFilePath ) ) {
39
+ versionFile = versionFile || '.python-version' ;
40
+ if ( ! fs . existsSync ( versionFile ) ) {
44
41
throw new Error (
45
- `The specified python version file at: ${ versionFilePath } does not exist`
42
+ `The specified python version file at: ${ versionFile } does not exist`
46
43
) ;
47
44
}
48
- version = fs . readFileSync ( versionFilePath , 'utf8' ) ;
45
+ version = fs . readFileSync ( versionFile , 'utf8' ) ;
49
46
core . info ( `Resolved ${ versionFile } as ${ version } ` ) ;
50
47
51
48
return version ;
You can’t perform that action at this time.
0 commit comments