Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose path and version in outputs #89

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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