Skip to content

Commit 43169ff

Browse files
authored
Merge pull request #7 from s0/dotfiles
Allow copying of dotfiles
2 parents 693ee9e + 06ac8ba commit 43169ff

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/workflows/test.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on: push
44
jobs:
55
deploy-ssh-no-branch:
66
name: Test deploying to a new branch
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@master
1010
- name: Setup Dummy Data
1111
run: |
1212
mkdir dummy
1313
echo "foobar" > "dummy/baz"
14+
echo "foobar" > "dummy/.bat"
1415
- name: Setup SSH Keys and known_hosts
1516
env:
1617
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
@@ -33,13 +34,14 @@ jobs:
3334
SSH_PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }}
3435
deploy-ssh-existing-branch:
3536
name: Test deploying to a pre-existing branch
36-
runs-on: ubuntu-latest
37+
runs-on: ubuntu-latest
3738
steps:
3839
- uses: actions/checkout@master
3940
- name: Setup Dummy Data
4041
run: |
4142
mkdir dummy
4243
echo "foobar" > "dummy/baz"
44+
echo "foobar" > "dummy/.bat"
4345
- name: Deploy
4446
uses: ./
4547
env:
@@ -49,13 +51,14 @@ jobs:
4951
SSH_PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }}
5052
deploy-ssh-existing-branch-known_hosts:
5153
name: Test deploying to a pre-existing branch (with KNOWN_HOSTS_FILE)
52-
runs-on: ubuntu-latest
54+
runs-on: ubuntu-latest
5355
steps:
5456
- uses: actions/checkout@master
5557
- name: Setup Dummy Data
5658
run: |
5759
mkdir dummy
5860
echo "foobar" > "dummy/baz"
61+
echo "foobar" > "dummy/.bat"
5962
- name: Deploy
6063
uses: ./
6164
env:
@@ -66,15 +69,17 @@ jobs:
6669
KNOWN_HOSTS_FILE: action/resources/known_hosts_github.com
6770
deploy-ssh-twice:
6871
name: Test deploying multiple times in one job
69-
runs-on: ubuntu-latest
72+
runs-on: ubuntu-latest
7073
steps:
7174
- uses: actions/checkout@master
7275
- name: Setup Dummy Data
7376
run: |
7477
mkdir dummy1
7578
echo "foobar1" > "dummy1/baz"
79+
echo "foobar1" > "dummy1/.bat"
7680
mkdir dummy2
7781
echo "foobar2" > "dummy2/baz"
82+
echo "foobar2" > "dummy2/.bat"
7883
- name: Deploy
7984
uses: ./
8085
env:
@@ -98,6 +103,7 @@ jobs:
98103
run: |
99104
mkdir dummy
100105
echo "foobar" > "dummy/baz"
106+
echo "foobar" > "dummy/.bat"
101107
- name: Deploy
102108
uses: ./
103109
env:

action/dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ var writeToProcess = function (command, args, opts) { return new Promise(functio
821821
folder = path.resolve(process.cwd(), config.folder);
822822
console.log("##[info] Copying all files from " + folder);
823823
// TODO: replace this copy with a node implementation
824-
return [4 /*yield*/, exec("cp -r " + folder + "/* ./", { env: env, cwd: REPO_TEMP })];
824+
return [4 /*yield*/, exec("cp -rT " + folder + "/ ./", { env: env, cwd: REPO_TEMP })];
825825
case 25:
826826
// TODO: replace this copy with a node implementation
827827
_e.sent();

action/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri
287287
const folder = path.resolve(process.cwd(), config.folder);
288288
console.log(`##[info] Copying all files from ${folder}`);
289289
// TODO: replace this copy with a node implementation
290-
await exec(`cp -r ${folder}/* ./`, { env, cwd: REPO_TEMP });
290+
await exec(`cp -rT ${folder}/ ./`, { env, cwd: REPO_TEMP });
291291
await exec(`git add -A .`, { env, cwd: REPO_TEMP });
292292
await exec(`git commit --allow-empty -m "Update ${config.branch} to output generated at ${sha}"`, { env, cwd: REPO_TEMP });
293293
console.log(`##[info] Pushing`);

0 commit comments

Comments
 (0)