Skip to content

Commit

Permalink
Expose path and version in outputs (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienvermeille committed Sep 8, 2023
1 parent 9b1ee5b commit 0fbeb49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ inputs:
repo-token:
description: 'GitHub repo token to use to avoid rate limiter'
default: ''
outputs:
version:
description: 'Actual version of the protoc compiler environment that has been installed'
path:
description: 'Path to where the protoc compiler has been installed'
runs:
using: 'node16'
main: 'dist/index.js'
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ function getProtoc(version, includePreReleases, repoToken) {
toolPath = yield downloadRelease(version);
process.stdout.write("Protoc cached under " + toolPath + os.EOL);
}
// expose outputs
core.setOutput("path", toolPath);
core.setOutput("version", targetVersion);
// add the bin folder to the PATH
core.addPath(path.join(toolPath, "bin"));
});
Expand Down
4 changes: 4 additions & 0 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export async function getProtoc(
process.stdout.write("Protoc cached under " + toolPath + os.EOL);
}

// expose outputs
core.setOutput("path", toolPath);
core.setOutput("version", targetVersion);

// add the bin folder to the PATH
core.addPath(path.join(toolPath, "bin"));
}
Expand Down

0 comments on commit 0fbeb49

Please sign in to comment.