Skip to content

Commit fe9489d

Browse files
author
Danny McCormick
authored
Use dotnet-version (#16)
1 parent 10a142b commit fe9489d

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ steps:
1919
- uses: actions/checkout@master
2020
- uses: actions/setup-dotnet@v1
2121
with:
22-
version: '2.2.103' // SDK Version to use.
22+
dotnet-version: '2.2.103' // SDK Version to use.
2323
- run: dotnet build <my project>
2424
```
2525
@@ -37,7 +37,7 @@ jobs:
3737
- name: Setup dotnet
3838
uses: actions/setup-dotnet@v1
3939
with:
40-
version: ${{ matrix.dotnet }}
40+
dotnet-version: ${{ matrix.dotnet }}
4141
- run: dotnet build <my project>
4242
```
4343

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ name: 'Setup Dotnet environment'
22
description: 'Setup a Dotnet environment and add it to the PATH, additionally providing proxy support'
33
author: 'GitHub'
44
inputs:
5-
version:
5+
dotnet-version:
66
description: 'SDK version to use. E.g. 2.2.104'
7+
# Deprecated option, do not use. Will not be supported after October 1, 2019
8+
version:
9+
description: 'Deprecated. Use dotnet-version instead. Will not be supported after October 1, 2019'
710
runs:
811
using: 'node12'
912
main: 'lib/setup-dotnet.js'

lib/setup-dotnet.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ function run() {
2525
// Version is optional. If supplied, install / use from the tool cache
2626
// If not supplied then task is still used to setup proxy, auth, etc...
2727
//
28-
const version = core.getInput('version');
28+
let version = core.getInput('version');
29+
if (!version) {
30+
version = core.getInput('dotnet-version');
31+
}
2932
if (version) {
3033
const dotnetInstaller = new installer.DotnetCoreInstaller(version);
3134
yield dotnetInstaller.installDotnet();

src/setup-dotnet.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ async function run() {
88
// Version is optional. If supplied, install / use from the tool cache
99
// If not supplied then task is still used to setup proxy, auth, etc...
1010
//
11-
const version = core.getInput('version');
11+
let version = core.getInput('version');
12+
if (!version) {
13+
version = core.getInput('dotnet-version');
14+
}
1215
if (version) {
1316
const dotnetInstaller = new installer.DotnetCoreInstaller(version);
1417
await dotnetInstaller.installDotnet();

0 commit comments

Comments
 (0)