Skip to content

Commit

Permalink
Permission modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Apr 23, 2022
1 parent 459b667 commit 1549ea0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
20 changes: 10 additions & 10 deletions __tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('git', () => {
const response = await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(13)
expect(execute).toBeCalledTimes(14)
expect(rmRF).toBeCalledTimes(1)
expect(response).toBe(Status.SUCCESS)
})
Expand All @@ -191,7 +191,7 @@ describe('git', () => {
const response = await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(12)
expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1)
expect(response).toBe(Status.SUCCESS)
})
Expand All @@ -216,7 +216,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(13)
expect(execute).toBeCalledTimes(14)
expect(rmRF).toBeCalledTimes(1)
})

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

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(12)
expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1)
})

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

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(12)
expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1)
})

Expand Down Expand Up @@ -296,7 +296,7 @@ describe('git', () => {
const response = await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(13)
expect(execute).toBeCalledTimes(14)
expect(rmRF).toBeCalledTimes(1)
expect(fs.existsSync).toBeCalledTimes(2)
expect(response).toBe(Status.SUCCESS)
Expand Down Expand Up @@ -328,7 +328,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
})
})
Expand All @@ -353,7 +353,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
})

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

await deploy(action)

expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
expect(mkdirP).toBeCalledTimes(1)
})
Expand All @@ -393,7 +393,7 @@ describe('git', () => {
})

const response = await deploy(action)
expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
expect(response).toBe(Status.SKIPPED)
})
Expand Down
4 changes: 2 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('main', () => {
debug: true
})
await run(action)
expect(execute).toBeCalledTimes(17)
expect(execute).toBeCalledTimes(18)
expect(rmRF).toBeCalledTimes(1)
expect(exportVariable).toBeCalledTimes(1)
})
Expand All @@ -73,7 +73,7 @@ describe('main', () => {
isTest: TestFlag.HAS_CHANGED_FILES
})
await run(action)
expect(execute).toBeCalledTimes(20)
expect(execute).toBeCalledTimes(21)
expect(rmRF).toBeCalledTimes(1)
expect(exportVariable).toBeCalledTimes(1)
})
Expand Down
9 changes: 8 additions & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ export async function deploy(action: ActionInterface): Promise<Status> {

await generateWorktree(action, temporaryDeploymentDirectory, branchExists)

/* Relaxes permissions of folder due to be deployed so rsync can write to/from it. */
await execute(
`chmod -R +rw ${action.folderPath}`,
action.workspace,
action.silent
)

This comment has been minimized.

Copy link
@liyishuai

liyishuai Apr 25, 2022

chmod complains "Operation not permitted".

// Ensures that items that need to be excluded from the clean job get parsed.
let excludes = ''
if (action.clean && action.cleanExclude) {
Expand Down Expand Up @@ -324,7 +331,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
)

await execute(
`chmod -R 777 ${temporaryDeploymentDirectory}`,
`chmod -R +rw ${temporaryDeploymentDirectory}`,
action.workspace,
action.silent
)
Expand Down

0 comments on commit 1549ea0

Please sign in to comment.