Skip to content

Commit 0fbeb49

Browse files
author
Sebastien Vermeille
authored
Expose path and version in outputs (#89)
1 parent 9b1ee5b commit 0fbeb49

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ inputs:
1111
repo-token:
1212
description: 'GitHub repo token to use to avoid rate limiter'
1313
default: ''
14+
outputs:
15+
version:
16+
description: 'Actual version of the protoc compiler environment that has been installed'
17+
path:
18+
description: 'Path to where the protoc compiler has been installed'
1419
runs:
1520
using: 'node16'
1621
main: 'dist/index.js'

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ function getProtoc(version, includePreReleases, repoToken) {
8585
toolPath = yield downloadRelease(version);
8686
process.stdout.write("Protoc cached under " + toolPath + os.EOL);
8787
}
88+
// expose outputs
89+
core.setOutput("path", toolPath);
90+
core.setOutput("version", targetVersion);
8891
// add the bin folder to the PATH
8992
core.addPath(path.join(toolPath, "bin"));
9093
});

src/installer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ export async function getProtoc(
6363
process.stdout.write("Protoc cached under " + toolPath + os.EOL);
6464
}
6565

66+
// expose outputs
67+
core.setOutput("path", toolPath);
68+
core.setOutput("version", targetVersion);
69+
6670
// add the bin folder to the PATH
6771
core.addPath(path.join(toolPath, "bin"));
6872
}

0 commit comments

Comments
 (0)