From 177150cb754f6d6710d628d12ccf78dfa9c76cc8 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Thu, 20 May 2021 15:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbuild=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ build.yml | 11 +++++------ shell/update.sh | 5 +++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ build.yml b/.github/workflows/ build.yml index a543e716..8211d374 100644 --- a/.github/workflows/ build.yml +++ b/.github/workflows/ build.yml @@ -23,12 +23,11 @@ jobs: env: GITHUB_REPO: gitee.com/whyour/qinglong-static run: | - git config --global user.email "imwhyour@gmail.com" - git config --global user.name "whyour" - git clone --depth 1 https://gitee.com/whyour/qinglong-static.git static + mkdir -p static cd ./static - rm -rf dist/* && rm -rf build/* cp -rf ../dist ./ && cp -rf ../build ./ - git add . + git init && git add . + git config user.name "whyour" + git config user.email "imwhyour@gmail.com" git commit --allow-empty -m "copy static at $(date +'%Y-%m-%d %H:%M:%S')" - git push --quiet "https://whyour:${{ secrets.API_TOKEN }}@${GITHUB_REPO}.git" master:master \ No newline at end of file + git push --force --quiet "https://whyour:${{ secrets.API_TOKEN }}@${GITHUB_REPO}.git" master \ No newline at end of file diff --git a/shell/update.sh b/shell/update.sh index cec93cc2..2da28b57 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -166,7 +166,8 @@ update_repo() { local repo_path="${dir_repo}/${author}_${repo}" if [ -d ${repo_path}/.git ]; then reset_romote_url ${repo_path} ${url} - git_pull_scripts ${repo_path} + git fetch + git reset --hard origin/master >/dev/null 2>&1 else git_clone_scripts ${url} ${repo_path} fi @@ -253,7 +254,7 @@ update_qinglong() { cp -f $file_config_sample $dir_config/config.sample.sh detect_config_version update_depend - + [ -f $dir_root/package.json ] && ql_depend_new=$(cat $dir_root/package.json) [[ "$ql_depend_old" != "$ql_depend_new" ]] && npm_install_2 $dir_root else