From 81815e69861d806dec9bf0090d4e0a3903ec4bc7 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sun, 27 Oct 2024 11:51:33 +0800 Subject: [PATCH] chore(workflows): update docker and generate-csv workflows --- .github/workflows/docker.yml | 3 ++- .github/workflows/generate-csv.yml | 36 +++++++++--------------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0c2bb68..5bbec05 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,7 +8,8 @@ on: - v* paths-ignore: - 'lankong_tools/**' - - '*.md' + - '*.md' + - '.github/**' env: IMAGE_NAME: random-api-go diff --git a/.github/workflows/generate-csv.yml b/.github/workflows/generate-csv.yml index 454cead..485d81b 100644 --- a/.github/workflows/generate-csv.yml +++ b/.github/workflows/generate-csv.yml @@ -32,38 +32,24 @@ jobs: repository: woodchen-ink/github-file token: ${{ secrets.TARGET_REPO_TOKEN }} path: target-repo - persist-credentials: false - - - name: Debug target repo access - run: | - cd target-repo - git remote -v - git status - env: - GITHUB_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }} - name: Copy and commit files run: | - # 显示源文件 - echo "Source files:" - ls -la public/ - - # 创建目标目录 - mkdir -p target-repo/random-api.czl.net/url - # 复制文件 - cp -rv public/* target-repo/random-api.czl.net/url/ - - # 显示目标文件 - echo "Target files:" - ls -la target-repo/random-api.czl.net/url/ - - # 提交更改 + cp -rv public/* 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 status git commit -m "Update CSV files [skip ci]" || echo "No changes to commit" - git push || (echo "Push failed with status $?" && exit 1) + + # 推送更改 + git push origin main