Skip to content

Commit 47a6d63

Browse files
blue-jampeaceiris
authored andcommitted
Fix: "git rm" fails when publish branch is empty (#24)
When a publish branch exists and it has no files, `git rm -r '*'` fails with ``` fatal: pathspec '*' did not match any files ``` `--ignore-unmatch` option let git exit with a zero status in this case. Reference: https://git-scm.com/docs/git-rm#Documentation/git-rm.txt---ignore-unmatch
1 parent 201f9af commit 47a6d63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ remote_branch="${PUBLISH_BRANCH}"
5555
local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
5656
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
5757
cd "${local_dir}"
58-
git rm -r '*'
58+
git rm -r --ignore-unmatch '*'
5959
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | \
6060
tail -n +2 | \
6161
xargs -I % cp -rf % "${local_dir}/"

0 commit comments

Comments
 (0)