Skip to content

Commit d34d41a

Browse files
committed
Modifies permissions
1 parent bd8e5da commit d34d41a

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ jobs:
223223
integration-container,
224224
integration-ssh,
225225
integration-ssh-third-party-client,
226-
integration-env
226+
integration-env,
227227
]
228228
runs-on: ubuntu-latest
229229
steps:

src/constants.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ export const action: ActionInterface = {
105105
? getInput('git-config-email')
106106
: pusher && pusher.email
107107
? pusher.email
108-
: `${
109-
process.env.GITHUB_ACTOR || 'github-pages-deploy-action'
110-
}@users.noreply.${
108+
: `${process.env.GITHUB_ACTOR ||
109+
'github-pages-deploy-action'}@users.noreply.${
111110
process.env.GITHUB_SERVER_URL
112111
? stripProtocolFromUrl(process.env.GITHUB_SERVER_URL)
113112
: 'github.com'

src/git.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,15 @@ export async function deploy(action: ActionInterface): Promise<Status> {
131131
await generateWorktree(action, temporaryDeploymentDirectory, branchExists)
132132

133133
/* 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-
)
134+
try {
135+
await execute(
136+
`chmod -R +rw ${action.folderPath}`,
137+
action.workspace,
138+
action.silent
139+
)
140+
} catch {
141+
info(`Unable to modify permissions…`)
142+
}
139143

140144
// Ensures that items that need to be excluded from the clean job get parsed.
141145
let excludes = ''

src/ssh.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export async function configureSSH(action: ActionInterface): Promise<void> {
2323
appendFileSync(sshKnownHostsDirectory, sshGitHubKnownHostDss)
2424

2525
// Initializes SSH agent.
26-
const agentOutput = execFileSync('ssh-agent').toString().split('\n')
26+
const agentOutput = execFileSync('ssh-agent')
27+
.toString()
28+
.split('\n')
2729

2830
agentOutput.map(line => {
29-
const exportableVariables =
30-
/^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(line)
31+
const exportableVariables = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(
32+
line
33+
)
3134

3235
if (exportableVariables && exportableVariables.length) {
3336
exportVariable(exportableVariables[1], exportableVariables[2])

src/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ export const suppressSensitiveInformation = (
9696
return value
9797
}
9898

99-
const orderedByLength = (
100-
[action.token, action.repositoryPath].filter(Boolean) as string[]
101-
).sort((a, b) => b.length - a.length)
99+
const orderedByLength = ([action.token, action.repositoryPath].filter(
100+
Boolean
101+
) as string[]).sort((a, b) => b.length - a.length)
102102

103103
for (const find of orderedByLength) {
104104
value = replaceAll(value, find, '***')

0 commit comments

Comments
 (0)