Skip to content

Commit 553ff3f

Browse files
author
Danny McCormick
authored
Merge branch 'master' into global-json
2 parents 8b1e9dd + fe9489d commit 553ff3f

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# setup-dotnet
22

3+
<p align="left">
4+
<a href="https://github.com/actions/setup-dotnet"><img alt="GitHub Actions status" src="https://github.com/actions/setup-dotnet/workflows/Main%20workflow/badge.svg"></a>
5+
</p>
6+
37
This action sets up a dotnet environment for use in actions by:
48

59
- optionally downloading and caching a version of dotnet by SDK version and adding to PATH
@@ -15,7 +19,7 @@ steps:
1519
- uses: actions/checkout@master
1620
- uses: actions/setup-dotnet@v1
1721
with:
18-
version: '2.2.103' // SDK Version to use.
22+
dotnet-version: '2.2.103' // SDK Version to use.
1923
- run: dotnet build <my project>
2024
```
2125
@@ -33,7 +37,7 @@ jobs:
3337
- name: Setup dotnet
3438
uses: actions/setup-dotnet@v1
3539
with:
36-
version: ${{ matrix.dotnet }}
40+
dotnet-version: ${{ matrix.dotnet }}
3741
- run: dotnet build <my project>
3842
```
3943

action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: 'Setup Dotnet for use with actions'
1+
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ function run() {
2727
// If not supplied then task is still used to setup proxy, auth, etc...
2828
//
2929
let version = core.getInput('version');
30+
if (!version) {
31+
version = core.getInput('dotnet-version');
32+
}
3033
if (!version) {
3134
// Try to fall back to global.json
3235
core.debug('No version found, trying to find version from global.json');

src/setup-dotnet.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export async function run() {
1010
// If not supplied then task is still used to setup proxy, auth, etc...
1111
//
1212
let version: string = core.getInput('version');
13+
if (!version) {
14+
version = core.getInput('dotnet-version');
15+
}
1316
if (!version) {
1417
// Try to fall back to global.json
1518
core.debug('No version found, trying to find version from global.json');

0 commit comments

Comments
 (0)