首页 > 解决方案 > 如何使 fork master 分支与 azerothcore master 分支保持同步

问题描述

如何自动使我的 fork master 分支与 AzerothCore master 分支保持同步?

标签: azerothcore

解决方案


您可以使用 GitHub Actions 使您的 fork master 分支保持同步:

on:
  schedule:
    - cron: "0 */6 * * *"
jobs:
  repo-sync:
    runs-on: ubuntu-latest
    steps:
    - name: repo-sync
      uses: wei/git-sync@v2
      with:
        source_repo: "https://github.com/azerothcore/azerothcore-wotlk.git"
        source_branch: "master"
        destination_repo: "https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN }}@github.com/${{ secrets.GH_USERNAME }}/azerothcore-wotlk.git"
        destination_branch: "master"

在 fork 存储库设置中创建秘密。您可以在此处参考如何添加它们: https ://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-一个存储库

就我而言,我创造了秘密GH_USERNAMEGH_TOKEN

GH_USERNAME应设置为您的 github 用户名。

GH_TOKEN应设置为您创建的个人访问令牌。

有关如何创建的信息,请参阅此处: https ://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token


推荐阅读