Skip to content

Commit

Permalink
Merge pull request #12 from manabie-com/feature/custom-only-build-tar…
Browse files Browse the repository at this point in the history
…get-branch-and-show-more-info

copy file to dir
  • Loading branch information
phungtruongnguyen94 authored Feb 8, 2022
2 parents b84c2b1 + 5412475 commit 49eddf9
Show file tree
Hide file tree
Showing 4 changed files with 6,389 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
}
]
]
},
"dependencies": {
"fs-extra": "^10.0.0"
}
}
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import fs from 'fs';
import fse from 'fs-extra'
import { getInput, setFailed, startGroup, endGroup, debug } from '@actions/core';
import { context, getOctokit } from '@actions/github';
import { exec } from '@actions/exec';
Expand Down Expand Up @@ -69,9 +70,17 @@ async function run(octokit, context, token, privateConfig) {
const workDir = getInput('cwd')
if (!fs.existsSync(workDir)){
fs.mkdirSync(workDir);
fse.copySync(process.cwd(), process.cwd() + workDir.replace(".", ""), {
overwrite: true,
filter: file => file !== process.cwd() + workDir.replace(".", "")
})
process.chdir(workDir)
console.log(`change dir to ${workDir}`)
} else {
fse.copySync(process.cwd(), process.cwd() + workDir.replace(".", ""), {
overwrite: true,
filter: file => file !== process.cwd() + workDir.replace(".", "")
})
process.chdir(workDir)
console.log(`change dir to ${workDir}`)
}
Expand Down
Loading

0 comments on commit 49eddf9

Please sign in to comment.