Skip to content

Commit 6c56d15

Browse files
committed
folder copy support
1 parent 68e7af9 commit 6c56d15

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,25 @@ FILES: |
8989
Nested file with same nested file structure destination
9090
```yaml
9191
FILES: |
92-
/.github/dependabot.yml
92+
.github/dependabot.yml
9393
```
9494
Nested file with new destination
9595
```yaml
9696
FILES: |
97-
/sync/dependabot.yml=.github/dependabot.yml
97+
sync/dependabot.yml=.github/dependabot.yml
9898
```
9999

100100
<u>Folder Sync</u>
101101

102102
Root folder to root directory
103103
```yaml
104104
FILES: |
105-
./sync
105+
sync
106106
```
107107
Root folder with new directory
108108
```yaml
109109
FILES: |
110-
./sync=newFolderName
110+
sync/=newFolderName/
111111
```
112112
### TOKEN parameter
113113
Use the repository secret named `ACTIONS`
@@ -116,6 +116,7 @@ TOKEN: ${{ secrets.ACTIONS }}
116116
```
117117

118118
## Troubleshooting
119+
### Spacing
119120
Spacing around the equal sign is important. For example, this will not work:
120121
```yaml
121122
FILES: |
@@ -130,4 +131,9 @@ instead of 1 object
130131

131132
- folder/file-sync.yml = folder/test.txt
132133

133-
and there is nothing I can do in code to make up for that
134+
and there is nothing I can do in code to make up for that
135+
136+
### Slashes
137+
You do not need (nor want) leading `/` for the file path on either side of the equal sign
138+
139+
The only time you need `/` trailing is for folder copies. While a file copy will technically still work with a leading `/`, a folder copy will not

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ for repository in "${REPOSITORIES[@]}"; do
102102

103103
# copy file
104104
echo "Copying: [$SOURCE_FULL_PATH] to [$DEST_FULL_PATH]"
105-
cp "${SOURCE_FULL_PATH}" "${DEST_FULL_PATH}"
105+
cp "${SOURCE_FULL_PATH}" "${DEST_FULL_PATH}" -r
106106

107107
# add file
108108
git add "${DEST_FULL_PATH}" -f

0 commit comments

Comments
 (0)