Skip to content

feat(ci): sync forks with DIYgod/RSSHub once a day - #23734

Merged
pseudoyu merged 1 commit into
masterfrom
feat/sync-fork
Oct 31, 2026
Merged

pseudoyu merged 1 commit into
masterfrom
feat/sync-fork

Conversation

@pseudoyu

@pseudoyu pseudoyu commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Involved Issue / 该 PR 相关 Issue

Close #23673

Example for the Proposed Route(s) / 路由地址示例

NOROUTE

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

In short: GitHub turned off the Pull app on October 1, so forks that used it to stay up to date stopped getting RSSHub changes (#23673). This PR adds a small workflow that runs only in forks and updates them from RSSHub once a day.

How fork updates work today

  • People who deploy RSSHub on Vercel, Heroku or Fly.io deploy from their own fork, so they only get new changes after the fork is updated.
  • The deployment guide tells them to install the Pull app for that. The app no longer runs, so these forks fall behind until someone clicks "Sync fork" by hand.

Why

  • Forks need an automatic way to update that does not depend on a third-party app.
  • GitHub Actions can do it, but the token every workflow gets by default is not allowed to change workflow files. RSSHub changed a workflow file on 13 of the 30 days before deploy: 提供一种不依赖于 pull App 的自动更新 fork 的方式 #23673, so with that token alone the update would fail about every other day.

What this PR changes

  1. Update forks once a day. A new workflow updates a fork from RSSHub every day, and the fork owner can also run it by hand. It never runs in DIYgod/RSSHub itself.
  2. Use the fork owner's token when there is one. If the fork has a secret named SYNC_TOKEN (a personal token that is allowed to change workflow files), the workflow uses it, so updates also work on days RSSHub changes a workflow. Without it, the default token is used, which works on the other days.
  3. Never overwrite a fork's own changes. If the fork has changes that conflict with RSSHub, the update stops with an error instead of resetting the fork.

Technical approach

  • .github/workflows/sync-fork.yml runs gh repo sync on the fork on a daily cron and on workflow_dispatch, guarded by github.repository_owner != 'DIYgod' like dependabot-fork.yml.
  • GH_TOKEN is secrets.SYNC_TOKEN || github.token, and the job only asks for contents: write.
  • gh repo sync without --force only fast-forwards or merges, and fails on a conflict.

To decide before merging

  • Forks have to turn on Actions for this to run, and that also turns on RSSHub's other workflows in the fork. The scheduled ones (the weekly full route test, which can now take 4 hours, plus stale and ghcr-retention) would then run in every such fork. The docs change tells fork owners to keep only "Sync fork" enabled and disable the rest. The other option is to guard those three with github.repository == 'DIYgod/RSSHub'; I left that out to keep this PR small.
  • In DIYgod/RSSHub the daily schedule shows up as one skipped run.
  • Rollback: revert this commit. Forks keep whatever they already synced.
  • Docs: docs(deploy): replace the Pull app with the Sync fork workflow RSSNext/rsshub-docs#291 replaces the Pull app steps in the deployment guide. Merge it after this PR.

Tests: actionlint and oxfmt pass. Not run end to end, because I have no fork to run it in; a fork owner can try it with "Run workflow".

Reviewer: TonyRL, who maintains the workflows. This needs a maintainer decision because it affects every fork that turns on Actions.

GitHub suspended the Pull app on 2026-10-01, so forks that relied on it
to stay up to date stopped receiving RSSHub changes. Add a workflow that
only runs in forks and updates the default branch from RSSHub daily or on
demand.

The default token cannot update files under .github/workflows, which
RSSHub changes often, so the workflow prefers a SYNC_TOKEN secret with
the workflow scope when the fork owner adds one. gh repo sync never
force-resets, so a fork with conflicting changes fails instead of losing
them.

Refs #23673
@pseudoyu
pseudoyu merged commit c9c1860 into master Oct 31, 2026
61 checks passed
@pseudoyu
pseudoyu deleted the feat/sync-fork branch October 31, 2026 02:21
pseudoyu added a commit to RSSNext/rsshub-docs that referenced this pull request Oct 31, 2026
GitHub suspended the Pull app on 2026-10-01 (wei/pull#674). Add a "Keep
Your Fork Updated" section that covers the manual Sync fork button and
the Sync fork workflow from DIYgod/RSSHub#23734 with a SYNC_TOKEN secret,
and point the Vercel, Heroku and Fly.io steps at it in both languages.
Fork owners are told to keep only the Sync fork workflow enabled, with a
danger callout about RSSHub's other workflows.

Refs DIYgod/RSSHub#23673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy: 提供一种不依赖于 pull App 的自动更新 fork 的方式

2 participants