Skip to content

Commit 1549ea0

Browse files
committed
Permission modifications
1 parent 459b667 commit 1549ea0

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
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(13)
171+
expect(execute).toBeCalledTimes(14)
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(12)
194+
expect(execute).toBeCalledTimes(13)
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(13)
219+
expect(execute).toBeCalledTimes(14)
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(12)
243+
expect(execute).toBeCalledTimes(13)
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(12)
268+
expect(execute).toBeCalledTimes(13)
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(13)
299+
expect(execute).toBeCalledTimes(14)
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(10)
331+
expect(execute).toBeCalledTimes(11)
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(10)
356+
expect(execute).toBeCalledTimes(11)
357357
expect(rmRF).toBeCalledTimes(1)
358358
})
359359

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

374374
await deploy(action)
375375

376-
expect(execute).toBeCalledTimes(10)
376+
expect(execute).toBeCalledTimes(11)
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(10)
396+
expect(execute).toBeCalledTimes(11)
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
@@ -53,7 +53,7 @@ describe('main', () => {
5353
debug: true
5454
})
5555
await run(action)
56-
expect(execute).toBeCalledTimes(17)
56+
expect(execute).toBeCalledTimes(18)
5757
expect(rmRF).toBeCalledTimes(1)
5858
expect(exportVariable).toBeCalledTimes(1)
5959
})
@@ -73,7 +73,7 @@ describe('main', () => {
7373
isTest: TestFlag.HAS_CHANGED_FILES
7474
})
7575
await run(action)
76-
expect(execute).toBeCalledTimes(20)
76+
expect(execute).toBeCalledTimes(21)
7777
expect(rmRF).toBeCalledTimes(1)
7878
expect(exportVariable).toBeCalledTimes(1)
7979
})

src/git.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ export async function deploy(action: ActionInterface): Promise<Status> {
130130

131131
await generateWorktree(action, temporaryDeploymentDirectory, branchExists)
132132

133+
/* Relaxes permissions of folder due to be deployed so rsync can write to/from it. */
134+
await execute(
135+
`chmod -R +rw ${action.folderPath}`,
136+
action.workspace,
137+
action.silent
138+
)
139+
133140
// Ensures that items that need to be excluded from the clean job get parsed.
134141
let excludes = ''
135142
if (action.clean && action.cleanExclude) {
@@ -324,7 +331,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
324331
)
325332

326333
await execute(
327-
`chmod -R 777 ${temporaryDeploymentDirectory}`,
334+
`chmod -R +rw ${temporaryDeploymentDirectory}`,
328335
action.workspace,
329336
action.silent
330337
)

0 commit comments

Comments
 (0)