ci: add merge-back workflow from main to develop #1

Merged
ComputerCrack merged 1 commit from feature/netoskur-q5b-merge-back-workflow into develop 2026-10-11 00:40:42 +00:00

Summary

New workflow .gitea/workflows/sync-develop.yml, triggered by every push to main:

on(push main)
  open PR main -> develop          (201 new | 409 reuse existing | 422 nothing to merge -> exit green)
  look up existing PR by base/head  (GET /pulls/develop/main, not "first open PR")
  merge PR via API (Do: merge)     (retry while 405 "not mergeable yet")
  on any other failure -> exit red, PR stays open for a human

Merge commit is created and signed by the Forgejo instance. Adapted from Portfolio sync-dev.yml with one change: existing-PR lookup by base/head instead of "first open PR".

Refs: Netoskur-q5b

Evidence

  • Before: no merge-back; hotfixes on main would have to be brought to develop by hand.
    After: not yet verified. The workflow only runs on a push to main, so the first real run is the first release or hotfix. YAML parses; no comments in the file.

Open assumptions:

  • GET /repos/{owner}/{repo}/pulls/{base}/{head} exists in this Forgejo version (known from the Gitea API).
  • Repo secret SYNC_TOKEN is set (not yet, see ticket).

Merge Danger

Door: two-way

Deleting the file disables it.

Blast Radius: develop

A wrong merge lands on develop only; main is never written. Without SYNC_TOKEN the job fails red and does nothing.

## Summary New workflow `.gitea/workflows/sync-develop.yml`, triggered by every push to `main`: ```text on(push main) open PR main -> develop (201 new | 409 reuse existing | 422 nothing to merge -> exit green) look up existing PR by base/head (GET /pulls/develop/main, not "first open PR") merge PR via API (Do: merge) (retry while 405 "not mergeable yet") on any other failure -> exit red, PR stays open for a human ``` Merge commit is created and signed by the Forgejo instance. Adapted from Portfolio `sync-dev.yml` with one change: existing-PR lookup by base/head instead of "first open PR". Refs: Netoskur-q5b ## Evidence - **Before:** no merge-back; hotfixes on `main` would have to be brought to `develop` by hand. **After:** not yet verified. The workflow only runs on a push to `main`, so the first real run is the first release or hotfix. YAML parses; no comments in the file. Open assumptions: - `GET /repos/{owner}/{repo}/pulls/{base}/{head}` exists in this Forgejo version (known from the Gitea API). - Repo secret `SYNC_TOKEN` is set (not yet, see ticket). ## Merge Danger **Door:** two-way Deleting the file disables it. **Blast Radius:** develop A wrong merge lands on `develop` only; `main` is never written. Without `SYNC_TOKEN` the job fails red and does nothing.
Signed-off-by: Jonathan Schmidt <kontakt@jonathan-schmidt.de>
ComputerCrack scheduled this pull request to auto merge when all checks succeed 2026-10-11 00:39:23 +00:00
ComputerCrack deleted branch feature/netoskur-q5b-merge-back-workflow 2026-10-11 00:40:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ComputerCrack/Netoskur!1
No description provided.