@@ -44,7 +44,7 @@ const gprNuGetConfig: string = `<?xml version="1.0" encoding="utf-8"?>
44
44
const twogprNuGetConfig : string = `<?xml version="1.0" encoding="utf-8"?>
45
45
<configuration>
46
46
<packageSources>
47
- <add key="GPR-GitHub" value="https://nuget.pkg.github.com/github /index.json" protocolVersion="3" />
47
+ <add key="GPR-GitHub" value="https://nuget.pkg.github.com/OwnerName /index.json" protocolVersion="3" />
48
48
<add key="GPR-Actions" value="https://nuget.pkg.github.com/actions/index.json" protocolVersion="3" />
49
49
</packageSources>
50
50
</configuration>` ;
@@ -94,7 +94,9 @@ 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/OwnerName/index.json' ) ;
97
+ await auth . configAuthentication (
98
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
99
+ ) ;
98
100
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
99
101
expect (
100
102
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -104,7 +106,9 @@ describe('authutil tests', () => {
104
106
it ( 'No existing config, auth token environment variable not provided, throws' , async ( ) => {
105
107
let thrown = false ;
106
108
try {
107
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
109
+ await auth . configAuthentication (
110
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
111
+ ) ;
108
112
} catch {
109
113
thrown = true ;
110
114
}
@@ -114,7 +118,9 @@ describe('authutil tests', () => {
114
118
it ( 'No existing config, sets up a full NuGet.config with URL and other owner/PAT for GPR' , async ( ) => {
115
119
process . env [ 'NUGET_AUTH_TOKEN' ] = 'TEST_FAKE_AUTH_TOKEN' ;
116
120
process . env [ 'INPUT_OWNER' ] = 'otherorg' ;
117
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/otherorg/index.json' ) ;
121
+ await auth . configAuthentication (
122
+ 'https://nuget.pkg.github.com/otherorg/index.json'
123
+ ) ;
118
124
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
119
125
expect (
120
126
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -130,7 +136,9 @@ describe('authutil tests', () => {
130
136
fs . writeFileSync ( inputNuGetConfigPath , invalidNuGetConfig ) ;
131
137
let thrown = false ;
132
138
try {
133
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
139
+ await auth . configAuthentication (
140
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
141
+ ) ;
134
142
} catch {
135
143
thrown = true ;
136
144
}
@@ -144,7 +152,9 @@ describe('authutil tests', () => {
144
152
'nuget.config'
145
153
) ;
146
154
fs . writeFileSync ( inputNuGetConfigPath , emptyNuGetConfig ) ;
147
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
155
+ await auth . configAuthentication (
156
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
157
+ ) ;
148
158
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
149
159
expect (
150
160
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -158,7 +168,9 @@ describe('authutil tests', () => {
158
168
'nuget.config'
159
169
) ;
160
170
fs . writeFileSync ( inputNuGetConfigPath , nugetorgNuGetConfig ) ;
161
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
171
+ await auth . configAuthentication (
172
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
173
+ ) ;
162
174
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
163
175
expect (
164
176
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -172,7 +184,9 @@ describe('authutil tests', () => {
172
184
'nuget.config'
173
185
) ;
174
186
fs . writeFileSync ( inputNuGetConfigPath , gprNuGetConfig ) ;
175
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
187
+ await auth . configAuthentication (
188
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
189
+ ) ;
176
190
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
177
191
expect (
178
192
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -186,7 +200,9 @@ describe('authutil tests', () => {
186
200
'nuget.config'
187
201
) ;
188
202
fs . writeFileSync ( inputNuGetConfigPath , gprnugetorgNuGetConfig ) ;
189
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
203
+ await auth . configAuthentication (
204
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
205
+ ) ;
190
206
expect ( fs . existsSync ( nugetConfigFile ) ) . toBe ( true ) ;
191
207
expect (
192
208
fs . readFileSync ( nugetConfigFile , { encoding : 'utf8' } )
@@ -216,7 +232,9 @@ describe('authutil tests', () => {
216
232
fs . writeFileSync ( inputNuGetConfigPath , spaceNuGetConfig ) ;
217
233
let thrown = false ;
218
234
try {
219
- await auth . configAuthentication ( 'https://nuget.pkg.github.com/OwnerName/index.json' ) ;
235
+ await auth . configAuthentication (
236
+ 'https://nuget.pkg.github.com/OwnerName/index.json'
237
+ ) ;
220
238
} catch {
221
239
thrown = true ;
222
240
}
0 commit comments