mirror of
https://github.com/status-im/actions-gh-pages.git
synced 2025-02-18 16:06:44 +00:00
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
This commit is contained in:
parent
201f9af234
commit
47a6d63ea8
@ -55,7 +55,7 @@ remote_branch="${PUBLISH_BRANCH}"
|
||||
local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
|
||||
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
|
||||
cd "${local_dir}"
|
||||
git rm -r '*'
|
||||
git rm -r --ignore-unmatch '*'
|
||||
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | \
|
||||
tail -n +2 | \
|
||||
xargs -I % cp -rf % "${local_dir}/"
|
||||
|
Loading…
x
Reference in New Issue
Block a user