mirror of
https://github.com/actions/setup-go.git
synced 2025-06-30 21:23:43 +00:00
Add go-version-from-file option
This commit is contained in:
parent
1616116e1b
commit
a707d84385
2 changed files with 49 additions and 1 deletions
|
@ -12,7 +12,14 @@ export async function run() {
|
|||
// versionSpec is optional. If supplied, install / use from the tool cache
|
||||
// If not supplied then problem matchers will still be setup. Useful for self-hosted.
|
||||
//
|
||||
let versionSpec = core.getInput('go-version');
|
||||
const versionFilePath = core.getInput('go-version-from-file');
|
||||
const versionSpecFromFile =
|
||||
versionFilePath &&
|
||||
fs
|
||||
.readFileSync(versionFilePath)
|
||||
.toString()
|
||||
.trim();
|
||||
let versionSpec = core.getInput('go-version') || versionSpecFromFile;
|
||||
|
||||
// stable will be true unless false is the exact input
|
||||
// since getting unstable versions should be explicit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue