Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
2ue committed Apr 29, 2024
1 parent fb91bca commit c4cf55f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const core = require('@actions/core')
const { execSync } = require('child_process')

async function run() {
console.log('-----enter----')
core.info('-----enter----')
execSync('pwd', { stdio: 'inherit' })
execSync('ls -al', { stdio: 'inherit' })
const sftp = new SSH2SftpClient('upload')
Expand All @@ -27,7 +27,6 @@ async function run() {
const remoteBaseDir = core.getInput('remote_base_dir', { required: true })
// const remoteBakPath = core.getInput('remote_bak_path')
try {
core.info('Start connect: ', localDir, localDir)
execSync(`ls -al ${localDir}`, { stdio: 'inherit' })
await sftp.connect({
host,
Expand All @@ -51,10 +50,10 @@ async function run() {
// console.log('Start Backup: ', remoteBaseDir, '=>', remoteBakPath)
// await sftp.rcopy(remoteBaseDir, `${remoteBakPath}/backup`)
// }
core.info('Start upload: ', localDir, '=>', remoteBaseDir)
core.info(`Start upload: ${localDir} => ${remoteBaseDir}`)
await sftp.uploadDir(localDir, remoteBaseDir, {
filter: (localPath, isDir) => {
core.debug('Upload: ', localPath, isDir)
core.info(`Upload: ${localPath}, ${isDir}`)
return true
}
})
Expand Down

0 comments on commit c4cf55f

Please sign in to comment.