diff --git a/README.md b/README.md index 2615cd6a..95e4aae5 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ All inputs are optional. `setAllVars`|false|Defines ALL version variables as environment variables, with a "NBGV_" prefix. Adds the `--all-vars` switch to the `nbgv cloud` command. `stamp`||The path to a file whose version setting should be changed to match the computed version. Supported file types: `package.json` `toolVersion`|latest stable|The version of the nbgv dotnet CLI tool to install and use. If not specified, the default is the latest stable version. +`toolFeed`|nuget.config content|An additional feed to search for the nbgv dotnet CLI tool. Default feeds may include https://api.nuget.org/v3/index.json or whatever is specified in a nuget.config file at the root of your repo. ## Outputs diff --git a/action.yml b/action.yml index 008c6ccb..0bcf9d60 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,9 @@ inputs: toolVersion: description: The version of the nbgv dotnet CLI tool to install and use. If not specified, the default is the latest stable version. required: false + toolFeed: + description: An additional feed to search for the nbgv dotnet CLI tool. Default feeds may include https://api.nuget.org/v3/index.json or whatever is specified in a nuget.config file at the root of your repo. + required: false outputs: CloudBuildNumber: description: The cloud build number diff --git a/src/main.ts b/src/main.ts index 76886431..3c6a6a2e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,6 +12,10 @@ async function run() { installArgs.push('--version', Inputs.toolVersion); } + if (Inputs.toolFeed) { + installArgs.push('--add-source', Inputs.toolFeed); + } + let exitCode = await exec('dotnet', installArgs, { ignoreReturnCode: true }); if (exitCode > 1) { throw new Error("dotnet tool install failed."); diff --git a/src/settings.ts b/src/settings.ts index de09ac09..11749bd9 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -23,4 +23,9 @@ export class Inputs { const result = core.getInput('toolVersion'); return result === '' || result === null ? undefined : result; } + + static get toolFeed(): string | undefined { + const result = core.getInput('toolFeed'); + return result === '' || result === null ? undefined : result; + } }