Skip to content

Commit 0b7ff13

Browse files
Creating upstream_async.yml workflow
1 parent 63d06da commit 0b7ff13

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/upstream_async.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
name: Upstream Sync
3+
4+
permissions:
5+
contents: write
6+
7+
on:
8+
schedule:
9+
- cron: "0 * * * *" # every day
10+
workflow_dispatch:
11+
12+
jobs:
13+
sync_latest_from_upstream:
14+
name: Sync latest commits from upstream repo
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.repository.fork }}
17+
18+
steps:
19+
# Step 1: run a standard checkout action
20+
- name: Checkout target repo
21+
uses: actions/checkout@v3
22+
23+
# Step 2: run the sync action
24+
- name: Sync upstream changes
25+
id: sync
26+
uses: aormsby/[email protected]
27+
with:
28+
upstream_sync_repo: NginxProxyManager/nginx-proxy-manager
29+
upstream_sync_branch: develop
30+
target_sync_branch: develop
31+
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
32+
33+
# Set test_mode true to run tests instead of the true action!!
34+
test_mode: false
35+
36+
- name: Sync check
37+
if: failure()
38+
run: |
39+
echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次,详细教程请查看:https://github.com/Yidadaa/ChatGPT-Next-Web/blob/main/README_CN.md#%E6%89%93%E5%BC%80%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0"
40+
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the detailed tutorial for instructions: https://github.com/Yidadaa/ChatGPT-Next-Web#enable-automatic-updates"
41+
exit 1

0 commit comments

Comments
 (0)