Skip to content

Commit 5514fea

Browse files
authored
Rename Update-fork.yaml to sync-upstream-pr.yml
1 parent f8b58a2 commit 5514fea

File tree

2 files changed

+51
-103
lines changed

2 files changed

+51
-103
lines changed

.github/workflows/Update-fork.yaml

Lines changed: 0 additions & 103 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Sync Upstream (PR-based)
2+
3+
on:
4+
schedule:
5+
- cron: "*/5 * * * *" # every 5 minutes
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
sync:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout fork
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Configure git
23+
run: |
24+
git config user.name "github-actions[bot]"
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
27+
- name: Add upstream
28+
run: |
29+
git remote add upstream https://github.com/github/docs.git || true
30+
git fetch upstream
31+
32+
- name: Create sync branch
33+
run: |
34+
git checkout -B upstream-sync upstream/main
35+
36+
- name: Push sync branch
37+
run: |
38+
git push origin upstream-sync --force
39+
40+
- name: Create or update PR
41+
uses: peter-evans/create-pull-request@v6
42+
with:
43+
branch: upstream-sync
44+
title: "⬆️ Sync with upstream (github/docs)"
45+
body: |
46+
Automated PR to sync this fork with the latest upstream changes.
47+
- Runs every 5 minutes
48+
- Fork-safe
49+
- No auto-merge
50+
base: main
51+
delete-branch: false

0 commit comments

Comments
 (0)