Skip to content

Commit b26777c

Browse files
author
MPCoreDeveloper
committed
fix: add user-defined dependency-submission workflow, replace broken system auto-submission
- Add .github/workflows/dependency-submission.yml using dotnet/dependency-submission@v2 - Harden NuGet.Config with <clear /> for deterministic feed resolution - Add explicit --configfile NuGet.Config to all dotnet commands in ci.yml - Fixes intermittent TypeError: Invalid URL from system-managed component-detection action
1 parent 5e0501d commit b26777c

File tree

3 files changed

+49
-16
lines changed

3 files changed

+49
-16
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ jobs:
4141
run: dotnet --info
4242

4343
- name: Restore dependencies
44-
run: dotnet restore SharpCoreDB.CI.slnf
44+
run: dotnet restore SharpCoreDB.CI.slnf --configfile NuGet.Config
4545

4646
- name: Fail on deprecated NuGet packages
4747
shell: pwsh
4848
run: |
49-
$output = dotnet list SharpCoreDB.CI.slnf package --deprecated
49+
$output = dotnet list SharpCoreDB.CI.slnf package --deprecated --configfile NuGet.Config
5050
$outputText = $output | Out-String
5151
Write-Host $outputText
5252
@@ -65,7 +65,7 @@ jobs:
6565
- name: Fail on vulnerable NuGet packages
6666
shell: pwsh
6767
run: |
68-
$output = dotnet list SharpCoreDB.CI.slnf package --vulnerable
68+
$output = dotnet list SharpCoreDB.CI.slnf package --vulnerable --configfile NuGet.Config
6969
$outputText = $output | Out-String
7070
Write-Host $outputText
7171
@@ -82,17 +82,17 @@ jobs:
8282
Write-Host "No vulnerable NuGet packages detected."
8383
8484
- name: Build
85-
run: dotnet build SharpCoreDB.CI.slnf --configuration Release --no-restore /p:ContinuousIntegrationBuild=true
85+
run: dotnet build SharpCoreDB.CI.slnf --configuration Release --no-restore /p:ContinuousIntegrationBuild=true --configfile NuGet.Config
8686

8787
- name: Test SharpCoreDB.Tests
88-
run: dotnet test tests/SharpCoreDB.Tests/SharpCoreDB.Tests.csproj --configuration Release --no-build --verbosity minimal --logger trx --results-directory ./TestResults/SharpCoreDB.Tests --collect:"XPlat Code Coverage" --filter "${{ env.CI_TEST_FILTER }}" --blame-hang --blame-hang-timeout 5m
88+
run: dotnet test tests/SharpCoreDB.Tests/SharpCoreDB.Tests.csproj --configuration Release --no-build --verbosity minimal --logger trx --results-directory ./TestResults/SharpCoreDB.Tests --collect:"XPlat Code Coverage" --filter "${{ env.CI_TEST_FILTER }}" --blame-hang --blame-hang-timeout 5m --configfile NuGet.Config
8989
timeout-minutes: 30
9090
env:
9191
CI: "true"
9292
GITHUB_ACTIONS: "true"
9393

9494
- name: Test SharpCoreDB.VectorSearch.Tests
95-
run: dotnet test tests/SharpCoreDB.VectorSearch.Tests/SharpCoreDB.VectorSearch.Tests.csproj --configuration Release --no-build --verbosity minimal --logger trx --results-directory ./TestResults/SharpCoreDB.VectorSearch.Tests --collect:"XPlat Code Coverage" --filter "${{ env.CI_TEST_FILTER }}" --blame-hang --blame-hang-timeout 5m
95+
run: dotnet test tests/SharpCoreDB.VectorSearch.Tests/SharpCoreDB.VectorSearch.Tests.csproj --configuration Release --no-build --verbosity minimal --logger trx --results-directory ./TestResults/SharpCoreDB.VectorSearch.Tests --collect:"XPlat Code Coverage" --filter "${{ env.CI_TEST_FILTER }}" --blame-hang --blame-hang-timeout 5m --configfile NuGet.Config
9696
timeout-minutes: 15
9797
env:
9898
CI: "true"
@@ -134,11 +134,4 @@ jobs:
134134
dotnet-version: '10.0.x'
135135

136136
- name: Pack NuGet packages
137-
run: dotnet pack SharpCoreDB.CI.slnf --configuration Release --output ./artifacts /p:ContinuousIntegrationBuild=true
138-
139-
- name: Upload NuGet artifacts
140-
uses: actions/upload-artifact@v4
141-
with:
142-
name: nuget-packages
143-
path: ./artifacts/*.nupkg
144-
if-no-files-found: error
137+
run: dotnet pack SharpCoreDB.CI.slnf --configuration Release --output ./artifacts /p:ContinuousIntegrationBuild=true --configfile NuGet.Config
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# User-defined dependency submission workflow
2+
# Replaces the broken GitHub system-managed "Automatic Dependency Submission" workflow
3+
# that uses an outdated actions/component-detection-dependency-submission-action@374343e SHA.
4+
#
5+
# This workflow uses the official Microsoft dotnet/dependency-submission action
6+
# which is purpose-built for .NET repositories and properly supports .NET 10.
7+
#
8+
# IMPORTANT: After adding this workflow, disable the system-managed
9+
# "Automatic Dependency Submission" in GitHub Settings:
10+
# Settings → Code security → Dependency graph → Automatic dependency submission → Disable
11+
12+
name: Dependency Submission
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
18+
permissions:
19+
contents: write
20+
21+
jobs:
22+
dependency-submission:
23+
name: Submit .NET Dependencies
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 10
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v5
33+
with:
34+
dotnet-version: '10.0.x'
35+
36+
- name: Submit dependencies
37+
uses: dotnet/dependency-submission@v2
38+
with:
39+
solution-path: 'SharpCoreDB.CI.slnf'

NuGet.Config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4+
<clear />
45
<!-- Official NuGet feed -->
56
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
67

78
<!-- OrchardCore Preview feed for preview packages -->
8-
<add key="orchardcore-preview" value="https://myget.org/F/orchardcore-preview/api/v3/index.json" />
9+
<add key="orchardcore-preview" value="https://myget.org/F/orchardcore-preview/api/v3/index.json" protocolVersion="3" />
910

1011
<!-- OrchardCore nightly feed (fallback) -->
11-
<add key="orchardcore-nightly" value="https://myget.org/F/orchardcore-nightly/api/v3/index.json" />
12+
<add key="orchardcore-nightly" value="https://myget.org/F/orchardcore-nightly/api/v3/index.json" protocolVersion="3" />
1213
</packageSources>
1314

1415
<packageSourceCredentials>

0 commit comments

Comments
 (0)