From 4c2309e83f110e73962f4912d98ab97cbed0bb00 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sun, 27 Oct 2024 12:00:38 +0800 Subject: [PATCH] chore(workflow): auto update CSV files by GitHub Actions --- .github/workflows/generate-csv.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/generate-csv.yml b/.github/workflows/generate-csv.yml index 485d81b..f129c8a 100644 --- a/.github/workflows/generate-csv.yml +++ b/.github/workflows/generate-csv.yml @@ -35,21 +35,20 @@ jobs: - name: Copy and commit files run: | - # 复制文件 - cp -rv public/* target-repo/random-api.czl.net/url/pic/ + # 创建目标目录 + mkdir -p target-repo/random-api.czl.net/url/pic + + # 复制所有CSV文件到pic目录 + find public -name "*.csv" -exec cp -v {} target-repo/random-api.czl.net/url/pic/ \; - # 配置 git cd target-repo git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - # 设置远程仓库URL(使用token认证) git remote set-url origin https://${{ secrets.TARGET_REPO_TOKEN }}@github.com/woodchen-ink/github-file.git - # 添加并提交更改 git add . - git commit -m "Update CSV files [skip ci]" || echo "No changes to commit" - - # 推送更改 + # 删除 [skip ci] 标记 + git commit -m "Auto update CSV files by GitHub Actions" || echo "No changes to commit" git push origin main