Files
certd/.github/workflows/sync-to-cnb-dev.yml
2026-03-20 13:53:12 +08:00

36 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: sync-to-cnb-dev
on:
push:
branches: ['v2-dev']
# schedule:
# - # 国际时间 19:17 执行北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
# - cron: '17 19 * * *'
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout work repo # 1. 检出当前仓库(certd-sync-work)
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
ref: v2-dev
- name: Set git user # 2. 给git命令设置用户名和邮箱,↙↙↙ 改成你的name和email
run: |
git config --global user.name "xiaojunnuo"
git config --global user.email "xiaojunnuo@qq.com"
- name: Set git token # 3. 给git命令设置token用于push到目标仓库
uses: de-vri-es/setup-git-credentials@v2
with: # token 格式为: username:password
credentials: https://cnb:${{secrets.TOKEN_CNB}}@cnb.cool
- name: push to cnb # 4. 执行同步
run: |
git remote add upstream https://cnb.cool/certd/certd.git
git push --set-upstream upstream v2-dev