Skip to content

Commit 2f75d1d

Browse files
Merge branch 'actions:main' into update-contributors-guide
2 parents e6a9a96 + 37b00c4 commit 2f75d1d

File tree

11 files changed

+33
-29
lines changed

11 files changed

+33
-29
lines changed

.github/workflows/check-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
cache: npm
3131

3232
- name: Install dependencies
33-
run: npm ci
33+
run: npm ci --ignore-scripts
3434

3535
- name: Rebuild the dist/ directory
3636
run: npm run build

.github/workflows/licensed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Check licenses
1616
steps:
1717
- uses: actions/checkout@v3
18-
- run: npm ci
18+
- run: npm ci --ignore-scripts
1919
- name: Install licensed
2020
run: |
2121
cd $RUNNER_TEMP

.github/workflows/workflow.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
with:
2727
node-version: 16.x
2828
cache: npm
29-
- run: npm ci
29+
- run: npm ci --ignore-scripts
3030
- run: npm run build
3131
- run: npm run format-check
3232
- run: npm test
3333
- name: Verify no unstaged changes
3434
if: runner.os != 'windows'
3535
run: __tests__/verify-no-unstaged-changes.sh
36-
36+
3737
test-setup-multiple-versions:
3838
runs-on: ${{ matrix.operating-system }}
3939
strategy:
@@ -50,9 +50,9 @@ jobs:
5050
uses: ./
5151
with:
5252
dotnet-version: |
53-
2.2.402
54-
3.1.404
55-
3.0.x
53+
2.2.402
54+
3.1.404
55+
3.0.x
5656
- name: Verify dotnet
5757
shell: pwsh
5858
run: __tests__/verify-dotnet.ps1 2.2.402 3.1.404 '3.0'
@@ -114,7 +114,7 @@ jobs:
114114
- name: Verify dotnet
115115
shell: pwsh
116116
run: __tests__/verify-dotnet.ps1 3.1 2.2
117-
117+
118118
test-setup-latest-patch-version:
119119
runs-on: ${{ matrix.operating-system }}
120120
strategy:

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run format

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# Tests are not run at push time since they can take 2-4 minutes to complete
5+
npm run format-check

__tests__/setup-dotnet.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ describe('setup-dotnet tests', () => {
1616
process.env.RUNNER_TOOL_CACHE = toolDir;
1717
process.env.DOTNET_INSTALL_DIR = toolDir;
1818
process.env.RUNNER_TEMP = tempDir;
19+
process.env['INPUT_INCLUDE-PRERELEASE'] = 'false';
1920
await io.rmRF(toolDir);
2021
await io.rmRF(tempDir);
2122
});

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ inputs:
1818
include-prerelease:
1919
description: 'Whether prerelease versions should be matched with non-exact versions (for example 5.0.0-preview.6 being matched by 5, 5.0, 5.x or 5.0.x). Defaults to false if not provided.'
2020
required: False
21+
default: 'false'
2122
runs:
2223
using: 'node16'
2324
main: 'dist/index.js'

dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@ function run() {
478478
}
479479
}
480480
if (versions.length) {
481-
const includePrerelease = (core.getInput('include-prerelease') || 'false').toLowerCase() ===
482-
'true';
481+
const includePrerelease = core.getBooleanInput('include-prerelease');
483482
let dotnetInstaller;
484483
for (const version of new Set(versions)) {
485484
dotnetInstaller = new installer.DotnetCoreInstaller(version, includePrerelease);

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@
88
"build": "tsc && ncc build",
99
"format": "prettier --write **/*.ts",
1010
"format-check": "prettier --check **/*.ts",
11+
"prepare": "husky install",
1112
"test": "jest",
1213
"update-installers": "nwget https://dot.net/v1/dotnet-install.ps1 -O externals/install-dotnet.ps1 && nwget https://dot.net/v1/dotnet-install.sh -O externals/install-dotnet.sh"
1314
},
14-
"husky": {
15-
"hooks": {
16-
"//": "Tests are not run at push time since they can take 2-4 minutes to complete",
17-
"pre-commit": "npm run format",
18-
"pre-push": "npm run format-check"
19-
}
20-
},
2115
"repository": {
2216
"type": "git",
2317
"url": "git+https://github.com/actions/setup-dotnet.git"
@@ -44,7 +38,7 @@
4438
"@types/node": "^16.11.25",
4539
"@types/semver": "^6.2.2",
4640
"@vercel/ncc": "^0.33.4",
47-
"husky": "^7.0.2",
41+
"husky": "^8.0.1",
4842
"jest": "^27.2.5",
4943
"jest-circus": "^27.2.5",
5044
"prettier": "^1.19.1",

src/setup-dotnet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export async function run() {
3838
}
3939

4040
if (versions.length) {
41-
const includePrerelease: boolean =
42-
(core.getInput('include-prerelease') || 'false').toLowerCase() ===
43-
'true';
41+
const includePrerelease: boolean = core.getBooleanInput(
42+
'include-prerelease'
43+
);
4444
let dotnetInstaller!: installer.DotnetCoreInstaller;
4545
for (const version of new Set<string>(versions)) {
4646
dotnetInstaller = new installer.DotnetCoreInstaller(

0 commit comments

Comments
 (0)