diff --git a/CHANGELOG.md b/CHANGELOG.md index 148fadcd..696cd6da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [v1.16.2] - 2021-12-22 + +[Release notes](https://github.com/betahuhn/repo-file-sync-action/releases/tag/v1.16.2) · [Compare](https://github.com/betahuhn/repo-file-sync-action/compare/v1.16.1...v1.16.2) · [Tag](https://github.com/betahuhn/repo-file-sync-action/tree/v1.16.2) · Archive ([zip](https://github.com/betahuhn/repo-file-sync-action/archive/v1.16.2.zip) · [tar.gz](https://github.com/betahuhn/repo-file-sync-action/archive/v1.16.2.tar.gz)) + +### Bug fixes + +- [`eb3a718`](https://github.com/betahuhn/repo-file-sync-action/commit/eb3a718) Add trailing slash to destination directories + +### Dependency updates + +- [`3863803`](https://github.com/betahuhn/repo-file-sync-action/commit/3863803) Bump @vercel/ncc from 0.33.0 to 0.33.1 +- [`54932d2`](https://github.com/betahuhn/repo-file-sync-action/commit/54932d2) Bump action-input-parser from 1.2.24 to 1.2.25 + ## [v1.16.1] - 2021-12-19 [Release notes](https://github.com/betahuhn/repo-file-sync-action/releases/tag/v1.16.1) · [Compare](https://github.com/betahuhn/repo-file-sync-action/compare/v1.16.0...v1.16.1) · [Tag](https://github.com/betahuhn/repo-file-sync-action/tree/v1.16.1) · Archive ([zip](https://github.com/betahuhn/repo-file-sync-action/archive/v1.16.1.zip) · [tar.gz](https://github.com/betahuhn/repo-file-sync-action/archive/v1.16.1.tar.gz)) diff --git a/dist/index.js b/dist/index.js index eb3cff6e..fd1a0f98 100644 --- a/dist/index.js +++ b/dist/index.js @@ -17834,11 +17834,14 @@ const copy = async (src, dest, deleteOrphaned, exclude) => { for (const file of destFileList) { if (srcFileList.indexOf(file) === -1) { - core.debug(`Found a orphaned file in the target repo - ${ dest }${ file }`) + const filePath = path.join(dest, file) + core.debug(`Found a orphaned file in the target repo - ${ filePath }`) + if (exclude !== undefined && exclude.includes(path.join(src, file))) { core.debug(`Excluding file ${ file }`) } else { - await fs.remove(`${ dest }${ file }`) + core.debug(`Removing file ${ file }`) + await fs.remove(filePath) } } } @@ -18105,14 +18108,15 @@ const run = async () => { const isDirectory = await pathIsDirectory(file.source) const source = isDirectory ? `${ addTrailingSlash(file.source) }` : file.source + const dest = isDirectory ? `${ addTrailingSlash(file.dest) }` : file.dest if (isDirectory) core.info(`Source is directory`) const deleteOrphaned = isDirectory && file.deleteOrphaned - await copy(source, localDestination, deleteOrphaned, file.exclude) + await copy(source, dest, deleteOrphaned, file.exclude) - await git.add(file.dest) + await git.add(dest) // Commit each file separately, if option is set to false commit all files at once later if (COMMIT_EACH_FILE === true) { diff --git a/package-lock.json b/package-lock.json index 77e7964e..17ae6a87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "repo-file-sync-action", - "version": "1.16.1", + "version": "1.16.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ff60ba69..a9519208 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "repo-file-sync-action", - "version": "1.16.1", + "version": "1.16.2", "description": "GitHub Action to keep files like Action workflows or entire directories in sync between multiple repositories.", "main": "dist/index.js", "scripts": {