Skip to content

Commit 538f0ff

Browse files
committed
[CNSL-2288] Add automated fork main sync with upstream
Adds sync-fork.yml: on every push to upstream main (and via manual workflow_dispatch), calls the cockroachdb/actions sync-fork reusable workflow to push upstream's main to crl-gh-actions-pr-bot's fork's main. Force-overwrites the fork on divergence (allow_fork_force_sync: true) - the fork is treated as a mirror. The reusable workflow no-ops unless github.repository matches the configured upstream_repo, so the file is safe to land on both upstream and any fork.
1 parent da96a3b commit 538f0ff

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/sync-fork.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Sync Fork
2+
3+
# Pushes cockroachdb/docs's main to the fork's main on every
4+
# commit to main. The reusable workflow no-ops when invoked anywhere other
5+
# than the configured upstream_repo.
6+
7+
on:
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read # Reusable workflow uses GITHUB_TOKEN to fetch this repo's main
14+
15+
jobs:
16+
sync:
17+
uses: cockroachdb/actions/.github/workflows/sync-fork.yml@v0
18+
with:
19+
upstream_repo: cockroachdb/docs
20+
fork_repo: crl-gh-actions-pr-bot/docs
21+
allow_fork_force_sync: false
22+
secrets:
23+
fork_push_token: ${{ secrets.FORK_PUSH_TOKEN }}

0 commit comments

Comments
 (0)