Commit 691f4af
fix: use dotnet nuget update source with raw PAT secret
Both previous approaches wrote credentials to the wrong NuGet config
path (~/. nuget/config/ is not scanned on Linux; NuGet reads
~/.nuget/NuGet/NuGet.Config). Credentials were silently ignored -> 401.
New approach:
- CI writes raw PAT to a temp file, passed as BuildKit secret id=nuget_pat
- Dockerfile uses `dotnet nuget update source` to inject credentials
directly into nuget.config (the correct config file) before restore
- nuget.config is backed up and restored in the same RUN instruction so
credentials never appear in the committed layer
- packageSourceMapping in nuget.config is fully preserved (only the
<packageSourceCredentials> section is modified by update source)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 621e630 commit 691f4af
2 files changed
Lines changed: 14 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 68 | + | |
82 | 69 | | |
83 | 70 | | |
84 | 71 | | |
| |||
99 | 86 | | |
100 | 87 | | |
101 | 88 | | |
102 | | - | |
| 89 | + | |
103 | 90 | | |
104 | 91 | | |
105 | 92 | | |
| |||
109 | 96 | | |
110 | 97 | | |
111 | 98 | | |
112 | | - | |
| 99 | + | |
113 | 100 | | |
114 | | - | |
| 101 | + | |
115 | 102 | | |
116 | 103 | | |
117 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | | - | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
0 commit comments