This repository was archived by the owner on Dec 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (46 loc) · 1.65 KB
/
sync.yml
File metadata and controls
57 lines (46 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "Sync with Upstream Repository"
on:
schedule:
# Run every hour at the top of the hour
- cron: '0 * * * *'
workflow_dispatch:
# Allow manual triggering for testing
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
# Prevent triggering this job in the upstream repo
if: github.repository != 'meshcloud/meshcloud-docs'
steps:
- name: Checkout current repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Add upstream remote
run: |
git remote add upstream https://github.com/meshcloud/meshcloud-docs.git
git remote -v
- name: Fetch from upstream
run: |
git fetch upstream
- name: Sync develop branch
run: |
echo "Syncing develop branch..."
git checkout -B develop upstream/develop
git push --force-with-lease origin develop
- name: Sync master branch
run: |
echo "Syncing master branch..."
git checkout -B master upstream/master
git push --force-with-lease origin master
- name: Summary
run: |
echo "✅ Successfully synced both develop and master branches from upstream"
echo "📍 Upstream: https://github.com/meshcloud/meshcloud-docs"
echo "📍 This repo: ${{ github.repository }}"