8000 Folder Permissions (#925) · Wulf/github-pages-deploy-action@755bf9f · GitHub
[go: up one dir, main page]

Skip to content 65E1

Commit 755bf9f

Browse files
authored
Folder Permissions (JamesIves#925)
* Unit Tests * Update main.test.ts
1 parent bd6d73e commit 755bf9f

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

__tests__/git.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('git', () => {
168168
const response = await deploy(action)
169169

170170
// Includes the call to generateWorktree
171-
expect(execute).toBeCalledTimes(12)
171+
expect(execute).toBeCalledTimes(13)
172172
expect(rmRF).toBeCalledTimes(1)
173173
expect(response).toBe(Status.SUCCESS)
174174
})
@@ -191,7 +191,7 @@ describe('git', () => {
191191
const response = await deploy(action)
192192

193193
// Includes the call to generateWorktree
194-
expect(execute).toBeCalledTimes(11)
194+
expect(execute).toBeCalledTimes(12)
195195
expect(rmRF).toBeCalledTimes(1)
196196
expect(response).toBe(Status.SUCCESS)
197197
})
@@ -216,7 +216,7 @@ describe('git', () => {
216216
await deploy(action)
217217

218218
// Includes the call to generateWorktree
219-
expect(execute).toBeCalledTimes(12)
219+
expect(execute).toBeCalledTimes(13)
220220
expect(rmRF).toBeCalledTimes(1)
221221
})
222222

@@ -240,7 +240,7 @@ describe('git', () => {
240240
await deploy(action)
241241

242242
// Includes the call to generateWorktree
243-
expect(execute).toBeCalledTimes(11)
243+
expect(execute).toBeCalledTimes(12)
244244
expect(rmRF).toBeCalledTimes(1)
245245
})
246246

@@ -265,7 +265,7 @@ describe('git', () => {
265265
await deploy(action)
266266

267267
// Includes the call to generateWorktree
268-
expect(execute).toBeCalledTimes(11)
268+
expect(execute).toBeCalledTimes(12)
269269
expect(rmRF).toBeCalledTimes(1)
270270
})
271271

@@ -296,7 +296,7 @@ describe('git', () => {
296296
const response = await deploy(action)
297297

298298
// Includes the call to generateWorktree
299-
expect(execute).toBeCalledTimes(12)
299+
expect(execute).toBeCalledTimes(13)
300300
expect(rmRF).toBeCalledTimes(1)
301301
expect(fs.existsSync).toBeCalledTimes(2)
302302
expect(response).toBe(Status.SUCCESS)
@@ -328,7 +328,7 @@ describe('git', () => {
328328
await deploy(action)
329329

330330
// Includes the call to generateWorktree
331-
expect(execute).toBeCalledTimes(9)
331+
expect(execute).toBeCalledTimes(10)
332332
expect(rmRF).toBeCalledTimes(1)
333333
})
334334
})
@@ -353,7 +353,7 @@ describe('git', () => {
353353
await deploy(action)
354354

355355
// Includes the call to generateWorktree
356-
expect(execute).toBeCalledTimes(9)
356+
expect(execute).toBeCalledTimes(10)
357357
expect(rmRF).toBeCalledTimes(1)
358358
})
359359

@@ -373,7 +373,7 @@ describe('git', () => {
373373

374374
await deploy(action)
375375

376-
expect(execute).toBeCalledTimes(9)
376+
expect(execute).toBeCalledTimes(10)
377377
expect(rmRF).toBeCalledTimes(1)
378378
expect(mkdirP).toBeCalledTimes(1)
379379
})
@@ -393,7 +393,7 @@ describe('git', () => {
393393
})
394394

395395
const response = await deploy(action)
396-
expect(execute).toBeCalledTimes(9)
396+
expect(execute).toBeCalledTimes(10)
397397
expect(rmRF).toBeCalledTimes(1)
398398
expect(response).toBe(Status.SKIPPED)
399399
})

__tests__/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('main', () => {
4949
debug: true
5050
})
5151
await run(action)
52-
expect(execute).toBeCalledTimes(14)
52+
expect(execute).toBeCalledTimes(15)
5353
expect(rmRF).toBeCalledTimes(1)
5454
expect(exportVariable).toBeCalledTimes(1)
5555
})
@@ -69,7 +69,7 @@ describe('main', () => {
6969
isTest: TestFlag.HAS_CHANGED_FILES
7070
})
7171
await run(action)
72-
expect(execute).toBeCalledTimes(17)
72+
expect(execute).toBeCalledTimes(18)
7373
expect(rmRF).toBeCalledTimes(1)
7474
expect(exportVariable).toBeCalledTimes(1)
7575
})

src/git.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ export async function deploy(action: ActionInterface): Promise<Status> {
226226
action.silent
227227
)
228228

229+
await execute(
230+
`chmod -R 777 ${temporaryDeploymentDirectory}`,
231+
action.workspace,
232+
action.silent
233+
)
234+
229235
await execute(
230236
`git worktree remove ${temporaryDeploymentDirectory} --force`,
231237
action.workspace,

0 commit comments

Comments
 (0)
0