假设我有2个回购的A和B,有什么方法我可以自动将文件从回购A(在任何推送活动)到指定的文件夹在回购B?
提前谢谢。
发布于 2022-04-21 00:03:02
我认为您可以创建一个带有cron作业的工作流,以便在回购B中以您想要的频率拉回回购A。例如,我设置了一个随机的cron。
on:
schedule:
- cron: "0 6 * * 1" # At 06:00 on Monday
jobs:
pull_upstream:
runs-on: ubuntu-latest
steps:
- name: Checkout repo B
uses: actions/checkout@v3
with:
repository: org/repo-b
path: main
- name: Pull repo A into B
run: |
git config --global user.email "jane.doe@gmail.com"
git config --global user.name "Jane Doe"
git remote add upstream git@github.com:<user>/<repo-a>.git
git fetch upstream
git merge upstream/main
git push origin mainhttps://stackoverflow.com/questions/71935333
复制相似问题