diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f1398e..1f53460 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,13 +4,14 @@ on: push jobs: deploy-ssh-no-branch: name: Test deploying to a new branch - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Setup Dummy Data run: | mkdir dummy echo "foobar" > "dummy/baz" + echo "foobar" > "dummy/.bat" - name: Setup SSH Keys and known_hosts env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock @@ -33,13 +34,14 @@ jobs: SSH_PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }} deploy-ssh-existing-branch: name: Test deploying to a pre-existing branch - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Setup Dummy Data run: | mkdir dummy echo "foobar" > "dummy/baz" + echo "foobar" > "dummy/.bat" - name: Deploy uses: ./ env: @@ -49,13 +51,14 @@ jobs: SSH_PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }} deploy-ssh-existing-branch-known_hosts: name: Test deploying to a pre-existing branch (with KNOWN_HOSTS_FILE) - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Setup Dummy Data run: | mkdir dummy echo "foobar" > "dummy/baz" + echo "foobar" > "dummy/.bat" - name: Deploy uses: ./ env: @@ -66,15 +69,17 @@ jobs: KNOWN_HOSTS_FILE: action/resources/known_hosts_github.com deploy-ssh-twice: name: Test deploying multiple times in one job - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Setup Dummy Data run: | mkdir dummy1 echo "foobar1" > "dummy1/baz" + echo "foobar1" > "dummy1/.bat" mkdir dummy2 echo "foobar2" > "dummy2/baz" + echo "foobar2" > "dummy2/.bat" - name: Deploy uses: ./ env: @@ -98,6 +103,7 @@ jobs: run: | mkdir dummy echo "foobar" > "dummy/baz" + echo "foobar" > "dummy/.bat" - name: Deploy uses: ./ env: diff --git a/action/dist/index.js b/action/dist/index.js index 6e3a922..e626e21 100644 --- a/action/dist/index.js +++ b/action/dist/index.js @@ -821,7 +821,7 @@ var writeToProcess = function (command, args, opts) { return new Promise(functio folder = path.resolve(process.cwd(), config.folder); console.log("##[info] Copying all files from " + folder); // TODO: replace this copy with a node implementation - return [4 /*yield*/, exec("cp -r " + folder + "/* ./", { env: env, cwd: REPO_TEMP })]; + return [4 /*yield*/, exec("cp -rT " + folder + "/ ./", { env: env, cwd: REPO_TEMP })]; case 25: // TODO: replace this copy with a node implementation _e.sent(); diff --git a/action/src/index.ts b/action/src/index.ts index cd5478a..baebceb 100644 --- a/action/src/index.ts +++ b/action/src/index.ts @@ -287,7 +287,7 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri const folder = path.resolve(process.cwd(), config.folder); console.log(`##[info] Copying all files from ${folder}`); // TODO: replace this copy with a node implementation - await exec(`cp -r ${folder}/* ./`, { env, cwd: REPO_TEMP }); + await exec(`cp -rT ${folder}/ ./`, { env, cwd: REPO_TEMP }); await exec(`git add -A .`, { env, cwd: REPO_TEMP }); await exec(`git commit --allow-empty -m "Update ${config.branch} to output generated at ${sha}"`, { env, cwd: REPO_TEMP }); console.log(`##[info] Pushing`);