mirror of
https://github.com/woodchen-ink/random-api-go.git
synced 2025-07-19 14:22:00 +08:00
chore(workflows): update docker and generate-csv workflows
This commit is contained in:
parent
ac191d4ab6
commit
81815e6986
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@ -9,6 +9,7 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'lankong_tools/**'
|
- 'lankong_tools/**'
|
||||||
- '*.md'
|
- '*.md'
|
||||||
|
- '.github/**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: random-api-go
|
IMAGE_NAME: random-api-go
|
||||||
|
38
.github/workflows/generate-csv.yml
vendored
38
.github/workflows/generate-csv.yml
vendored
@ -32,38 +32,24 @@ jobs:
|
|||||||
repository: woodchen-ink/github-file
|
repository: woodchen-ink/github-file
|
||||||
token: ${{ secrets.TARGET_REPO_TOKEN }}
|
token: ${{ secrets.TARGET_REPO_TOKEN }}
|
||||||
path: target-repo
|
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
|
- name: Copy and commit files
|
||||||
run: |
|
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/
|
cp -rv public/* target-repo/random-api.czl.net/url/pic/
|
||||||
|
|
||||||
# 显示目标文件
|
# 配置 git
|
||||||
echo "Target files:"
|
|
||||||
ls -la target-repo/random-api.czl.net/url/
|
|
||||||
|
|
||||||
# 提交更改
|
|
||||||
cd target-repo
|
cd target-repo
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
git add .
|
|
||||||
git status
|
# 设置远程仓库URL(使用token认证)
|
||||||
git commit -m "Update CSV files [skip ci]" || echo "No changes to commit"
|
git remote set-url origin https://${{ secrets.TARGET_REPO_TOKEN }}@github.com/woodchen-ink/github-file.git
|
||||||
git push || (echo "Push failed with status $?" && exit 1)
|
|
||||||
|
# 添加并提交更改
|
||||||
|
git add .
|
||||||
|
git commit -m "Update CSV files [skip ci]" || echo "No changes to commit"
|
||||||
|
|
||||||
|
# 推送更改
|
||||||
|
git push origin main
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user