Skills von blackbook: software-development/gitea-repo-management

This commit is contained in:
2026-12-02 05:07:27 +01:00
parent f055d8afe8
commit aa14233e17
2 changed files with 8 additions and 0 deletions
@@ -15,6 +15,7 @@ description: Use for gitea.mindboost.team repos, PRs and n8n layout.
- Push with the working user embedded in the URL (`https://USER:PW@host/...`), mask the password in output with sed, and keep the stored remote URL clean. Put restructuring work on a `feature/...` branch and open a PR via `POST /api/v1/repos/<owner>/<repo>/pulls` (Basic auth with the same account) instead of pushing to main.
- Check CI with `GET .../actions/runs?limit=N` (fields: `path`, `event`, `conclusion`) and `.../actions/runs/<id>/jobs`; secrets list is `.../actions/secrets`. The first push to main of a repo with an auto-deploy action runs it: without `N8N_*` secrets it fails harmlessly, but once secrets exist it deploys, so warn the user while another repo still deploys the same workflow ids.
- `empty: true` in the repo API can be stale right after the first push; compare `git rev-parse HEAD` with the fetched remote head instead.
- **Protected `main`:** A direct push is rejected (`pre-receive hook declined ... protected branch`), even when the user says "hotfix without PR". Do not touch branch protection. Take the lightest sanctioned route: push a `hotfix/...` branch (one commit), open the PR via API, poll `.../commits/<branch>/status` until the required checks are `success` (an earlier merge call returns 405 `Not all required status checks successful`), then `POST .../pulls/<n>/merge` with `{"Do":"merge","delete_branch_after_merge":true}`. Before pushing to a repo that auto-deploys, diff its workflow file against the live workflow so the deploy changes nothing but the intended value.
## Splitting part of a repo into a new repo (keeping history)
Recipe and checks: `references/repo-split.md`. Short form: dependency analysis first, ask scope questions, `git filter-repo` on a throwaway single-branch clone, fix cross-repo paths, run the tests, only then create and push.