mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Modifies permissions
This commit is contained in:
parent
bd8e5da3f8
commit
d34d41a21e
2
.github/workflows/integration.yml
vendored
2
.github/workflows/integration.yml
vendored
@ -223,7 +223,7 @@ jobs:
|
|||||||
integration-container,
|
integration-container,
|
||||||
integration-ssh,
|
integration-ssh,
|
||||||
integration-ssh-third-party-client,
|
integration-ssh-third-party-client,
|
||||||
integration-env
|
integration-env,
|
||||||
]
|
]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -105,9 +105,8 @@ export const action: ActionInterface = {
|
|||||||
? getInput('git-config-email')
|
? getInput('git-config-email')
|
||||||
: pusher && pusher.email
|
: pusher && pusher.email
|
||||||
? pusher.email
|
? pusher.email
|
||||||
: `${
|
: `${process.env.GITHUB_ACTOR ||
|
||||||
process.env.GITHUB_ACTOR || 'github-pages-deploy-action'
|
'github-pages-deploy-action'}@users.noreply.${
|
||||||
}@users.noreply.${
|
|
||||||
process.env.GITHUB_SERVER_URL
|
process.env.GITHUB_SERVER_URL
|
||||||
? stripProtocolFromUrl(process.env.GITHUB_SERVER_URL)
|
? stripProtocolFromUrl(process.env.GITHUB_SERVER_URL)
|
||||||
: 'github.com'
|
: 'github.com'
|
||||||
|
14
src/git.ts
14
src/git.ts
@ -131,11 +131,15 @@ export async function deploy(action: ActionInterface): Promise<Status> {
|
|||||||
await generateWorktree(action, temporaryDeploymentDirectory, branchExists)
|
await generateWorktree(action, temporaryDeploymentDirectory, branchExists)
|
||||||
|
|
||||||
/* Relaxes permissions of folder due to be deployed so rsync can write to/from it. */
|
/* Relaxes permissions of folder due to be deployed so rsync can write to/from it. */
|
||||||
await execute(
|
try {
|
||||||
`chmod -R +rw ${action.folderPath}`,
|
await execute(
|
||||||
action.workspace,
|
`chmod -R +rw ${action.folderPath}`,
|
||||||
action.silent
|
action.workspace,
|
||||||
)
|
action.silent
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
info(`Unable to modify permissions…`)
|
||||||
|
}
|
||||||
|
|
||||||
// Ensures that items that need to be excluded from the clean job get parsed.
|
// Ensures that items that need to be excluded from the clean job get parsed.
|
||||||
let excludes = ''
|
let excludes = ''
|
||||||
|
@ -23,11 +23,14 @@ export async function configureSSH(action: ActionInterface): Promise<void> {
|
|||||||
appendFileSync(sshKnownHostsDirectory, sshGitHubKnownHostDss)
|
appendFileSync(sshKnownHostsDirectory, sshGitHubKnownHostDss)
|
||||||
|
|
||||||
// Initializes SSH agent.
|
// Initializes SSH agent.
|
||||||
const agentOutput = execFileSync('ssh-agent').toString().split('\n')
|
const agentOutput = execFileSync('ssh-agent')
|
||||||
|
.toString()
|
||||||
|
.split('\n')
|
||||||
|
|
||||||
agentOutput.map(line => {
|
agentOutput.map(line => {
|
||||||
const exportableVariables =
|
const exportableVariables = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(
|
||||||
/^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(line)
|
line
|
||||||
|
)
|
||||||
|
|
||||||
if (exportableVariables && exportableVariables.length) {
|
if (exportableVariables && exportableVariables.length) {
|
||||||
exportVariable(exportableVariables[1], exportableVariables[2])
|
exportVariable(exportableVariables[1], exportableVariables[2])
|
||||||
|
@ -96,9 +96,9 @@ export const suppressSensitiveInformation = (
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
const orderedByLength = (
|
const orderedByLength = ([action.token, action.repositoryPath].filter(
|
||||||
[action.token, action.repositoryPath].filter(Boolean) as string[]
|
Boolean
|
||||||
).sort((a, b) => b.length - a.length)
|
) as string[]).sort((a, b) => b.length - a.length)
|
||||||
|
|
||||||
for (const find of orderedByLength) {
|
for (const find of orderedByLength) {
|
||||||
value = replaceAll(value, find, '***')
|
value = replaceAll(value, find, '***')
|
||||||
|
Loading…
Reference in New Issue
Block a user