@@ -29,15 +29,15 @@ const nugetorgNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
29
29
const gprnugetorgNuGetConfig : string = `<?xml version="1.0" encoding="utf-8"?>
30
30
<configuration>
31
31
<packageSources>
32
- <add key="GPR" value="https://nuget.pkg.github.com/github /index.json" protocolVersion="3" />
32
+ <add key="GPR" value="https://nuget.pkg.github.com/OwnerName /index.json" protocolVersion="3" />
33
33
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
34
34
</packageSources>
35
35
</configuration>` ;
36
36
37
37
const gprNuGetConfig : string = `<?xml version="1.0" encoding="utf-8"?>
38
38
<configuration>
39
39
<packageSources>
40
- <add key="GPR" value="https://nuget.pkg.github.com/github /index.json" protocolVersion="3" />
40
+ <add key="GPR" value="https://nuget.pkg.github.com/OwnerName /index.json" protocolVersion="3" />
41
41
</packageSources>
42
42
</configuration>` ;
43
43
@@ -52,7 +52,7 @@ const twogprNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
52
52
const spaceNuGetConfig : string = `<?xml version="1.0" encoding="utf-8"?>
53
53
<configuration>
54
54
<packageSources>
55
- <add key="GPR GitHub" value="https://nuget.pkg.github.com/github /index.json" protocolVersion="3" />
55
+ <add key="GPR GitHub" value="https://nuget.pkg.github.com/OwnerName /index.json" protocolVersion="3" />
56
56
</packageSources>
57
57
</configuration>` ;
58
58
@@ -94,7 +94,7 @@ describe('authutil tests', () => {
94
94
95
95
it ( 'No existing config, sets up a full NuGet.config with URL and user/PAT for GPR' , async ( ) => {
96
96
process . env [ 'NUGET_AUTH_TOKEN' ] = 'TEST_FAKE_AUTH_TOKEN' ;
97
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
97
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
98
98
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
99
99
expect (
100
100
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -104,7 +104,7 @@ describe('authutil tests', () => {
104
104
it ( 'No existing config, auth token environment variable not provided, throws' , async ( ) => {
105
105
let thrown = false ;
106
106
try {
107
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
107
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
108
108
} catch {
109
109
thrown = true ;
110
110
}
@@ -114,7 +114,7 @@ describe('authutil tests', () => {
114
114
it ( 'No existing config, sets up a full NuGet.config with URL and other owner/PAT for GPR' , async ( ) => {
115
115
process . env [ 'NUGET_AUTH_TOKEN' ] = 'TEST_FAKE_AUTH_TOKEN' ;
116
116
process . env [ 'INPUT_OWNER' ] = 'otherorg' ;
117
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
117
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/otherorg/index.json ' ) ;
118
118
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
119
119
expect (
120
120
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -130,7 +130,7 @@ describe('authutil tests', () => {
130
130
fs . writeFileSync ( inputNuGetConfigPath , invalidNuGetConfig ) ;
131
131
let thrown = false ;
132
132
try {
133
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
133
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
134
134
} catch {
135
135
thrown = true ;
136
136
}
@@ -144,7 +144,7 @@ describe('authutil tests', () => {
144
144
'nuget.config'
145
145
) ;
146
146
fs . writeFileSync ( inputNuGetConfigPath , emptyNuGetConfig ) ;
147
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
147
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
148
148
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
149
149
expect (
150
150
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -158,7 +158,7 @@ describe('authutil tests', () => {
158
158
'nuget.config'
159
159
) ;
160
160
fs . writeFileSync ( inputNuGetConfigPath , nugetorgNuGetConfig ) ;
161
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
161
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
162
162
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
163
163
expect (
164
164
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -172,7 +172,7 @@ describe('authutil tests', () => {
172
172
'nuget.config'
173
173
) ;
174
174
fs . writeFileSync ( inputNuGetConfigPath , gprNuGetConfig ) ;
175
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
175
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
176
176
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
177
177
expect (
178
178
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -186,7 +186,7 @@ describe('authutil tests', () => {
186
186
'nuget.config'
187
187
) ;
188
188
fs . writeFileSync ( inputNuGetConfigPath , gprnugetorgNuGetConfig ) ;
189
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
189
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
190
190
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
191
191
expect (
192
192
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -216,7 +216,7 @@ describe('authutil tests', () => {
216
216
fs . writeFileSync ( inputNuGetConfigPath , spaceNuGetConfig ) ;
217
217
let thrown = false ;
218
218
try {
219
- await auth . configAuthentication ( 'https://nuget.pkg.github.com' ) ;
219
+ await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json ' ) ;
220
220
} catch {
221
221
thrown = true ;
222
222
}
@@ -236,7 +236,7 @@ describe('authutil tests', () => {
236
236
fs . mkdirSync ( inputNuGetConfigDirectory , { recursive : true } ) ;
237
237
fs . writeFileSync ( inputNuGetConfigPath , gprNuGetConfig ) ;
238
238
await auth . configAuthentication (
239
- 'https://nuget.pkg.github.com' ,
239
+ 'https://nuget.pkg.github.com/OwnerName/index.json ' ,
240
240
'subfolder/nuget.config'
241
241
) ;
242
242
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
0 commit comments