Compare commits

..

6 Commits
v5.3.0 ... main

Author SHA1 Message Date
Stephen Cleary
26b0ec14cb Expand the CSC problem matcher to light up more errors on GitHub. (#717)
Expand csc problem matcher with more real-world scenarios.

Co-authored-by: Stephen Cleary <900597+StephenCleary@users.noreply.github.com>
2026-06-25 14:00:19 -05:00
Kranthi Poturaju
da5e5482f2 docs(action): explicitly mark all optional inputs with required: false (#737)
Co-authored-by: Kranthi Poturaju <Kranthi.Poturaju1@aexp.com>
2026-06-23 12:45:52 -05:00
Michal Domanski
9bd3b44355 Improve readability of global.json creation command (#694)
Updated the command to create global.json for better readability and execution.
2026-06-23 12:35:56 -05:00
Jason Ginchereau
4406a635cd Bump @actions/cache to 5.1.0, log cache write denied (#746)
* Bump @actions/cache to 5.1.0, log cache write denied

* Add cache save failure test case

* Update dist

* Resolve high-severity audit issues
2026-06-22 13:33:08 -05:00
priya-kinthali
dc3262dda8 pin actions to commit SHAs in workflows (#744)
* fix basic validation with npm command

* Revert "fix basic validation with npm command"

This reverts commit 27a0803a2a.

* pin workflow actions to full commit SHAs with patch

* update cooldown

* update redundant global.json test and rollForward fields

* update cooldown for npm section
2026-06-22 11:59:12 -05:00
Priya Gupta
95a3f8b067 Validate global.json SDK version before rollForward optimization (#742) 2026-06-16 12:26:42 -05:00
28 changed files with 44505 additions and 67864 deletions

11
.github/csc.json vendored
View File

@@ -4,13 +4,14 @@
"owner": "csc",
"pattern": [
{
"regexp": "^([^\\s].*)\\((\\d+)(?:,\\d+|,\\d+,\\d+)?\\):\\s+(error|warning)\\s+([a-zA-Z]+(?<!MSB)\\d+):\\s*(.*?)\\s+\\[(.*?)\\]$",
"regexp": "^\\s*(?:\\d+>\\s*)?([^\\s].*)\\((\\d+)(?:,(\\d+))?(?:,\\d+)*\\):\\s+(error|warning)\\s+([a-zA-Z]+(?<!MSB)\\d*):\\s*(.*?)\\s+\\[(.*?)\\]$",
"file": 1,
"line": 2,
"severity": 3,
"code": 4,
"message": 5,
"fromPath": 6
"column": 3,
"severity": 4,
"code": 5,
"message": 6,
"fromPath": 7
}
]
}

View File

@@ -12,6 +12,8 @@ updates:
# Check the npm registry for updates every day (weekdays)
schedule:
interval: 'weekly'
cooldown:
default-days: 7
# Enable version updates for GitHub Actions
- package-ecosystem: 'github-actions'
@@ -20,3 +22,5 @@ updates:
directory: '/'
schedule:
interval: 'weekly'
cooldown:
default-days: 7

View File

@@ -27,7 +27,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -57,7 +57,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -92,7 +92,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -123,7 +123,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -149,7 +149,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -180,7 +180,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -208,7 +208,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -239,7 +239,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -247,7 +247,7 @@ jobs:
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "9.0.308","rollForward": "latestFeature"}}' > ./subdirectory/global.json
echo '{"sdk":{"version": "9.0.308"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
@@ -265,7 +265,7 @@ jobs:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -273,14 +273,14 @@ jobs:
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "3.1.0","rollForward": "latestMajor"}}' > ./subdirectory/global.json
echo '{"sdk":{"version": "8.0.100","rollForward": "latestMajor"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^(?!3)"
run: __tests__/verify-dotnet.ps1 -Patterns "^(?!8)"
test-setup-global-json-rollforward-latestfeature:
runs-on: ${{ matrix.operating-system }}
@@ -290,7 +290,7 @@ jobs:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -315,7 +315,7 @@ jobs:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -332,38 +332,6 @@ jobs:
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0.1(?!00)"
test-setup-global-json-only:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "10.0.101","rollForward": "latestFeature"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
test-global-json-with-comments:
runs-on: ${{ matrix.operating-system }}
strategy:
@@ -379,7 +347,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -387,7 +355,7 @@ jobs:
shell: bash
run: |
mkdir subdirectory
echo '/* should support comments */ {"sdk":{"version": "10.0.101","rollForward": "latestFeature"}} // should support comments' > ./subdirectory/global.json
echo '/* should support comments */ {"sdk":{"version": "10.0.101"}} // should support comments' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
@@ -411,7 +379,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -442,7 +410,7 @@ jobs:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -480,7 +448,7 @@ jobs:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -514,7 +482,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -547,7 +515,7 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -587,7 +555,7 @@ jobs:
http_proxy: http://squid-proxy:3128
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -610,7 +578,7 @@ jobs:
no_proxy: github.com,download.visualstudio.microsoft.com,api.nuget.org,builds.dotnet.microsoft.com,ci.dot.net
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -642,7 +610,7 @@ jobs:
higher-version: ['10.0.101']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -671,7 +639,7 @@ jobs:
[ubuntu-latest, windows-latest, macos-15-intel, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -710,7 +678,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
@@ -738,7 +706,7 @@ jobs:
operating-system: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
@@ -758,7 +726,7 @@ jobs:
operating-system: [macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}

View File

@@ -14,7 +14,7 @@ jobs:
steps:
- name: Checking out
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Publish
id: publish
uses: actions/publish-immutable-action@v0.0.4
uses: actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978 # v0.0.4

View File

@@ -23,7 +23,7 @@ jobs:
steps:
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.4.0
uses: actions/publish-action@23f4c6f12633a2da8f44938b71fde9afec138fb4 # v0.4.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -28,7 +28,7 @@ jobs:
dotnet-version: ['8.0', '9.0', '10.0']
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}

View File

@@ -1,6 +1,6 @@
---
name: "@actions/cache"
version: 5.0.5
version: 5.1.0
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache

View File

@@ -1,30 +0,0 @@
---
name: "@fastify/busboy"
version: 2.1.1
type: npm
summary: A streaming parser for HTML form data for node.js
homepage:
license: mit
licenses:
- sources: LICENSE
text: |-
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
notices: []

11
.licenses/npm/@nodable/entities.dep.yml generated Normal file
View File

@@ -0,0 +1,11 @@
---
name: "@nodable/entities"
version: 2.2.0
type: npm
summary: Entity parser for XML, HTML, External entites with security and NCR control
homepage:
license: mit
licenses:
- sources: README.md
text: MIT
notices: []

View File

@@ -1,16 +1,17 @@
---
name: undici
version: 6.24.1
name: anynum
version: 1.0.1
type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org
summary: Normalize all Unicode decimal digits (Devanagari, Arabic, Thai, etc.) to
ASCII numerals. Zero dependencies, performance-first.
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Matteo Collina and Undici contributors
Copyright (c) 2026 Natural Intelligence
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,6 +1,6 @@
---
name: brace-expansion
version: 1.1.13
version: 1.1.15
type: npm
summary: Brace expansion as known from sh/bash
homepage: https://github.com/juliangruber/brace-expansion

View File

@@ -1,9 +1,9 @@
---
name: fast-xml-builder
version: 1.1.4
version: 1.2.0
type: npm
summary: Build XML from JSON without C/C++ based libraries
homepage:
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,9 +1,9 @@
---
name: fast-xml-parser
version: 5.5.11
version: 5.9.2
type: npm
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
homepage:
homepage:
license: mit
licenses:
- sources: LICENSE

35
.licenses/npm/is-unsafe.dep.yml generated Normal file
View File

@@ -0,0 +1,35 @@
---
name: is-unsafe
version: 1.0.1
type: npm
summary: Zero-dependency, DOM-free, pure predicate for detecting unsafe strings across
HTML, XML, SVG, SQL, SHELL, and REGEX contexts
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2026 Natural Intelligence
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- sources: README.md
text: MIT
notices: []

View File

@@ -1,6 +1,6 @@
---
name: path-expression-matcher
version: 1.4.0
version: 1.5.0
type: npm
summary: Efficient path tracking and pattern matching for XML/JSON parsers
homepage: https://github.com/NaturalIntelligence/path-expression-matcher#readme

View File

@@ -1,9 +1,9 @@
---
name: strnum
version: 2.2.3
version: 2.4.1
type: npm
summary: Parse String to Number based on configuration
homepage:
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,6 +1,6 @@
---
name: undici
version: 5.29.0
version: 6.27.0
type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org

12
.licenses/npm/xml-naming.dep.yml generated Normal file
View File

@@ -0,0 +1,12 @@
---
name: xml-naming
version: 0.1.0
type: npm
summary: Validates XML name productions — Name, NCName, QName, NMToken, NMTokens —
for XML 1.0 and 1.1
homepage:
license: mit
licenses:
- sources: README.md
text: MIT
notices: []

View File

@@ -142,7 +142,7 @@ steps:
working-directory: csharp
```
> **Note**: The action supports `latest*` variants of the [rollForward](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#rollforward) field in `global.json`. When set to `latestPatch`, `latestFeature`, `latestMinor`, or `latestMajor`, the action installs the appropriate SDK version.
> **Note**: The action supports `latest*` variants of the [rollForward](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#rollforward) field in `global.json`. When set to `latestPatch`, `latestFeature`, `latestMinor`, or `latestMajor`, the action installs the appropriate SDK version. For prerelease versions, the exact pinned version is always installed regardless of the `rollForward` setting.
## Caching NuGet Packages
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching global packages data but requires less configuration settings. The `cache` input is optional, and caching is turned off by default.
@@ -239,7 +239,8 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Create temporary global.json
run: echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
run: |
echo '{"sdk":{"version": "${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json
- name: Execute dotnet
run: dotnet build <my project>
```

View File

@@ -3,6 +3,7 @@ import * as core from '@actions/core';
import fs from 'node:fs';
import {run} from '../src/cache-save';
import {getNuGetFolderPath} from '../src/cache-utils';
import {State} from '../src/constants';
jest.mock('@actions/cache');
jest.mock('@actions/core');
@@ -84,4 +85,22 @@ describe('cache-save tests', () => {
expect(jest.mocked(core.getState)).toHaveBeenCalledTimes(2);
expect(jest.mocked(cache.saveCache)).toHaveBeenCalled();
});
it('does not fail and traces when saveCache returns -1', async () => {
jest.mocked(core.getBooleanInput).mockReturnValue(true);
jest.mocked(core.getState).mockImplementation(s => s);
jest.mocked(fs.existsSync).mockReturnValue(true);
jest.mocked(cache.saveCache).mockResolvedValue(-1);
await run();
expect(jest.mocked(core.setFailed)).not.toHaveBeenCalled();
expect(jest.mocked(cache.saveCache)).toHaveBeenCalled();
expect(jest.mocked(core.debug)).toHaveBeenCalledWith(
`Cache was not saved for the key: ${State.CachePrimaryKey}`
);
expect(jest.mocked(core.info)).not.toHaveBeenCalledWith(
`Cache saved with the key: ${State.CachePrimaryKey}`
);
});
});

View File

@@ -1,45 +1,96 @@
import cscFile from '../.github/csc.json';
describe('csc tests', () => {
test('regular expression in csc.json is valid', async () => {
const regexPattern = cscFile['problemMatcher'][0]['pattern'][0]['regexp'];
const regexResultsMap = cscFile['problemMatcher'][0]['pattern'][0];
const regexPattern = cscFile['problemMatcher'][0]['pattern'][0]['regexp'];
const regexResultsMap = cscFile['problemMatcher'][0]['pattern'][0];
const regex = new RegExp(regexPattern);
const regex = new RegExp(regexPattern);
const stringsToMatch = [
'Program.cs(10,79): error CS1002: ; expected [/Users/zacharyeisinger/Documents/repo/setup-dotnet/__tests__/sample-broken-csproj/sample.csproj]',
"S:\\Msbuild\\src\\Build\\Evaluation\\ExpressionShredder.cs(33,7): error CS1003: Syntax error, ',' expected [S:\\msbuild\\src\\Build\\Microsoft.Build.csproj > Properties:prop]"
];
// Expected results are calculated according to the csc matcher located in csc.json file
const expectedResults = [
{
const testCases: Array<{input: string; results: Record<string, string>}> = [
{
input:
'Program.cs(10,79): error CS1002: ; expected [/Users/zacharyeisinger/Documents/repo/setup-dotnet/__tests__/sample-broken-csproj/sample.csproj]',
results: {
file: 'Program.cs',
line: '10',
column: '79',
severity: 'error',
code: 'CS1002',
message: '; expected',
fromPath:
'/Users/zacharyeisinger/Documents/repo/setup-dotnet/__tests__/sample-broken-csproj/sample.csproj'
},
{
}
},
{
input:
"S:\\Msbuild\\src\\Build\\Evaluation\\ExpressionShredder.cs(33,7): error CS1003: Syntax error, ',' expected [S:\\msbuild\\src\\Build\\Microsoft.Build.csproj > Properties:prop]",
results: {
file: 'S:\\Msbuild\\src\\Build\\Evaluation\\ExpressionShredder.cs',
line: '33',
column: '7',
severity: 'error',
code: 'CS1003',
message: "Syntax error, ',' expected",
fromPath:
'S:\\msbuild\\src\\Build\\Microsoft.Build.csproj > Properties:prop'
}
];
},
{
// `dotnet format` style error
input:
'C:\\actions-runner\\_work\\Some\\Folder\\SomeFile.cs(222,8): error WHITESPACE: Fix whitespace formatting. Delete 1 characters. [C:\\actions-runner\\_work\\Some\\Folder\\SomeProject.csproj]',
results: {
file: 'C:\\actions-runner\\_work\\Some\\Folder\\SomeFile.cs',
line: '222',
column: '8',
severity: 'error',
code: 'WHITESPACE',
message: 'Fix whitespace formatting. Delete 1 characters.',
fromPath: 'C:\\actions-runner\\_work\\Some\\Folder\\SomeProject.csproj'
}
},
{
// CSC error with whitespace prefix
input:
' /Volumes/Code/ghe_actions-2.301.1/Some/Folder/SomeFile.cs(10,8): error CS1014: A get or set accessor expected [/Volumes/Code/ghe_actions-2.301.1/Some/Folder/SomeProject.csproj]',
results: {
file: '/Volumes/Code/ghe_actions-2.301.1/Some/Folder/SomeFile.cs',
line: '10',
column: '8',
severity: 'error',
code: 'CS1014',
message: 'A get or set accessor expected',
fromPath:
'/Volumes/Code/ghe_actions-2.301.1/Some/Folder/SomeProject.csproj'
}
},
{
// CSC error with MSBuild prefix
input:
' 20>C:\\actions-runner\\_work\\Some\\Folder\\SomeFile.cs(8,2): error CS1014: A get or set accessor expected [C:\\actions-runner\\_work\\Some\\Folder\\SomeProject.csproj]',
results: {
file: 'C:\\actions-runner\\_work\\Some\\Folder\\SomeFile.cs',
line: '8',
column: '2',
severity: 'error',
code: 'CS1014',
message: 'A get or set accessor expected',
fromPath: 'C:\\actions-runner\\_work\\Some\\Folder\\SomeProject.csproj'
}
}
];
stringsToMatch.map((string, index) => {
const matchedResultsArray = string.match(regex);
for (const propName in expectedResults[index]) {
test.each(testCases)(
'regex matches and parses: $input',
({input, results}: {input: string; results: Record<string, string>}) => {
const matchedResultsArray = input.match(regex);
expect(matchedResultsArray).not.toBeNull();
for (const propName in results) {
const propertyIndex = regexResultsMap[propName];
const expectedPropValue = expectedResults[index][propName];
const expectedPropValue = results[propName];
const matchedPropValue = matchedResultsArray![propertyIndex];
expect(matchedPropValue).toEqual(expectedPropValue);
}
});
}, 10000);
},
10000
);
});

View File

@@ -7,18 +7,25 @@ branding:
inputs:
dotnet-version:
description: 'Optional SDK version(s) to use. If not provided, will install global.json version when available. Examples: 2.2.104, 3.1, 3.1.x, 3.x, 6.0.2xx, latest'
required: false
dotnet-quality:
description: 'Optional quality of the build. The possible values are: daily, preview, ga.'
required: false
dotnet-channel:
description: 'Optional channel for the installation. The possible values are: STS, LTS, A.B (e.g. 8.0), A.B.Cxx (e.g. 8.0.1xx, available since 5.0). To be used with "dotnet-version: latest".'
required: false
global-json-file:
description: 'Optional global.json location, if your global.json isn''t located in the root of the repo.'
required: false
source-url:
description: 'Optional package source for which to set up authentication. Will consult any existing NuGet.config in the root of the repo and provide a temporary NuGet.config using the NUGET_AUTH_TOKEN environment variable as a ClearTextPassword'
required: false
owner:
description: 'Optional OWNER for using packages from GitHub Package Registry organizations/users other than the current repository''s owner. Only used if a GPR URL is also provided in source-url'
required: false
config-file:
description: 'Optional NuGet.config location, if your NuGet.config isn''t located in the root of the repo.'
required: false
cache:
description: 'Optional input to enable caching of the NuGet global-packages folder'
required: false

56695
dist/cache-save/index.js vendored

File diff suppressed because one or more lines are too long

54612
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

682
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "setup-dotnet",
"version": "5.3.0",
"version": "5.4.0",
"private": true,
"description": "setup dotnet action",
"main": "dist/setup/index.js",
@@ -29,14 +29,14 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^5.0.5",
"@actions/cache": "^5.1.0",
"@actions/core": "^2.0.3",
"@actions/exec": "^2.0.0",
"@actions/github": "^6.0.0",
"@actions/glob": "^0.5.1",
"@actions/http-client": "^3.0.2",
"@actions/io": "^2.0.0",
"fast-xml-parser": "^5.5.11",
"fast-xml-parser": "^5.9.2",
"json5": "^2.2.3",
"semver": "^7.6.0"
},
@@ -60,6 +60,9 @@
"typescript": "^5.9.2",
"wget-improved": "^3.2.1"
},
"overrides": {
"undici": "^6.24.1"
},
"jest": {
"testEnvironment": "node"
}

View File

@@ -47,7 +47,11 @@ const cachePackages = async () => {
}
const cacheId = await cache.saveCache([cachePath], primaryKey);
if (cacheId == -1) {
if (cacheId === -1) {
// saveCache returns -1 without throwing when the cache was not saved, e.g.
// a reserve collision or a read-only token (fork PR). @actions/cache has
// already logged the reason at the appropriate severity, so just trace it.
core.debug(`Cache was not saved for the key: ${primaryKey}`);
return;
}

View File

@@ -207,7 +207,16 @@ function getVersionFromGlobalJson(globalJsonPath: string): string {
if (globalJson.sdk && globalJson.sdk.version) {
version = globalJson.sdk.version;
const rollForward = globalJson.sdk.rollForward;
if (rollForward) {
if (rollForward && !semver.prerelease(version)) {
const versionPattern = /^\d+\.\d+\.[1-9]\d{2,}$/;
if (!versionPattern.test(version)) {
throw new Error(
`Version '${version}' is not valid for the 'sdk.version' value in global.json. ` +
`When 'rollForward' is specified, a full SDK version is required. ` +
`See: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json`
);
}
const [major, minor, featurePatch] = version.split('.');
const feature = featurePatch.substring(0, 1);