Support absolute paths in node-version-file (#1633)

* path.resolve for composite actions

* log and documentation update

---------

Co-authored-by: mahabaleshwars <147705296+mahabaleshwars@users.noreply.github.com>
This commit is contained in:
v-mahabaleshwars
2026-09-21 15:25:01 -05:00
committed by GitHub
co-authored by mahabaleshwars
parent db0fb3a98e
commit 680d1e489b
4 changed files with 39 additions and 3 deletions
+3 -1
View File
@@ -101351,7 +101351,9 @@ function resolveVersionInput() {
return version;
}
if (versionFileInput) {
const versionFilePath = external_path_.join(process.env.GITHUB_WORKSPACE, versionFileInput);
// `path.resolve` (unlike `path.join`) keeps an already-absolute input as-is,
// so a composite action can pass `${{ github.action_path }}/.nvmrc`.
const versionFilePath = external_path_.resolve(process.env.GITHUB_WORKSPACE, versionFileInput);
const parsedVersion = getNodeVersionFromFile(versionFilePath);
if (parsedVersion) {
version = parsedVersion;