Unverified Commit adfb6750 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Doc] Added auto sync workflow (#3496)

parent f45f75b4
name: Upstream Sync
permissions:
contents: write
on:
schedule:
# Every day at 00:00
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync_latest_from_upstream:
name: Sync latest commits from upstream repo
runs-on: ubuntu-latest
# only run this workflow on the main repository, not on forks (to avoid infinite loops)
if: ${{ github.event.repository.fork && github.repository != 'DataLinkDC/dinky' }}
steps:
# Step 1: run a standard checkout action
- name: Checkout target repo
uses: actions/checkout@v3
# Step 2: run the sync action
- name: Sync upstream changes
id: sync
uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
with:
upstream_sync_repo: DataLinkDC/dinky
upstream_sync_branch: dev
target_sync_branch: dev
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
# Set test_mode true to run tests instead of the true action!!
test_mode: false
- name: Sync check
if: failure()
run: |
echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次."
echo "[Error] Due to changes in the workflow file of the upstream warehouse, GitHub has automatically paused this automatic update. You need to manually Sync Fork once."
exit 1
---
sidebar_position: 105
position: 105
id: auto_sync
title: 自动同步主仓库
---
:::info 简介
自动同步主仓库 (upstream) 的代码到你的仓库 (origin),保持你的仓库代码与主仓库代码同步。
:::
## 步骤
1. Fork 主仓库到你的 GitHub 账号下.
2. 点击 Fork 之后的仓库, 点击 `Actions` 标签.
3. 会提示一些介绍, 点击 `I understand my workflows, go ahead and enable them` 按钮.
4. 完成之后,会在每天的 00:00:00 执行同步操作. 后续该 workflow 文件不改变的情况下,会一直按照定时配置自动执行同步操作.
--- ---
sidebar_position: 7 sidebar_position: 111
position: 7 position: 111
id: code_format id: code_format
title: 代码格式化 title: 代码格式化
--- ---
......
--- ---
sidebar_position: 3 sidebar_position: 108
position: 3 position: 108
id: commit_code id: commit_code
title: 提交代码须知 title: 提交代码须知
--- ---
......
--- ---
sidebar_position: 4 sidebar_position: 109
position: 4 position: 109
id: commit_message id: commit_message
title: Commit Message 须知 title: Commit Message 须知
--- ---
......
--- ---
sidebar_position: 5 sidebar_position: 110
position: 5 position: 110
id: document id: document
title: 文档贡献 title: 文档贡献
--- ---
......
--- ---
sidebar_position: 6 sidebar_position: 104
position: 6 position: 104
id: how_contribute id: how_contribute
title: 如何贡献 title: 如何贡献
--- ---
......
--- ---
sidebar_position: 1 sidebar_position: 106
position: 1 position: 106
id: issue id: issue
title: Issue 须知 title: Issue 须知
--- ---
......
--- ---
sidebar_position: 2 sidebar_position: 107
position: 2 position: 107
id: pull_request id: pull_request
title: Pull Request 须知 title: Pull Request 须知
--- ---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment