From a68c251d0abee91059436cc048e36915649a2f42 Mon Sep 17 00:00:00 2001 From: Ryan Hamamura <58859899+ryanhamamura@users.noreply.github.com> Date: Fri, 20 Feb 2026 08:15:48 -1000 Subject: [PATCH] chore: make Gitea the primary remote, GitHub as mirror - Migrate CI workflow from GitHub Actions to Gitea Actions - Update /pr command to create/merge PRs on Gitea only - Update /release command to create releases on Gitea only - Remove /pr-create and /pr-merge commands (consolidated into /pr) - Push code and tags to both remotes for GitHub mirroring --- .claude/commands/pr-create.md | 12 ------------ .claude/commands/pr-merge.md | 9 --------- .claude/commands/pr.md | 22 ++++++++++------------ .claude/commands/release.md | 9 ++++----- {.github => .gitea}/workflows/ci.yml | 3 --- CLAUDE.md | 1 - 6 files changed, 14 insertions(+), 42 deletions(-) delete mode 100644 .claude/commands/pr-create.md delete mode 100644 .claude/commands/pr-merge.md rename {.github => .gitea}/workflows/ci.yml (93%) diff --git a/.claude/commands/pr-create.md b/.claude/commands/pr-create.md deleted file mode 100644 index 7718b3f..0000000 --- a/.claude/commands/pr-create.md +++ /dev/null @@ -1,12 +0,0 @@ -Create a PR from the current branch on both GitHub and Gitea. - -1. If in a worktree (working directory contains `.claude/worktrees/`), you are already on a feature branch — do NOT create a new one. Otherwise, create a new branch from main with a descriptive name. -2. Stage and commit all changes with a clean, semantic commit message. No Claude attribution lines. -3. Fetch latest main: `git fetch origin main`. -4. Rebase onto main: `git rebase origin/main`. - - If conflicts occur, abort the rebase (`git rebase --abort`), analyze the conflicting files, write a plan to resolve them, and present the plan to the user before proceeding. -5. Push the branch to origin with `-u` (use `--force-with-lease` if the branch was already pushed). -6. Push the branch to gitea: `git push gitea `. -7. Create a GitHub PR: `gh pr create`. Reference related issues with `#X`. Only use `Closes #X` if the PR fully resolves the issue. -8. Create a Gitea PR: `tea pr create --head --base main` with the same title and description. -9. Report both PR URLs. diff --git a/.claude/commands/pr-merge.md b/.claude/commands/pr-merge.md deleted file mode 100644 index e86e62e..0000000 --- a/.claude/commands/pr-merge.md +++ /dev/null @@ -1,9 +0,0 @@ -PR checks pass. Squash and merge the PR on both GitHub and Gitea. - -1. Squash-merge on GitHub: `gh pr merge --squash` with a clean, semantic commit message including the PR number. No Claude attribution lines. -2. Squash-merge on Gitea: `tea pr merge --style squash` with the same message. -3. Push main to gitea to keep commits in sync: `git push gitea main`. -4. Delete the remote feature branch on origin: `git push origin --delete `. -5. Delete the remote feature branch on gitea: `git push gitea --delete `. -6. Prune remote tracking refs: `git remote prune origin && git remote prune gitea`. -7. If in a worktree, leave the local branch alone — Claude Code handles worktree cleanup on session exit. If NOT in a worktree, delete the local feature branch and switch to main. diff --git a/.claude/commands/pr.md b/.claude/commands/pr.md index ed4b9ae..9cef145 100644 --- a/.claude/commands/pr.md +++ b/.claude/commands/pr.md @@ -1,16 +1,14 @@ -Create a PR, wait for CI, and squash-merge it on both GitHub and Gitea. This is the standard single-command workflow. +Create a PR on Gitea, wait for CI, and squash-merge it. Push code to both remotes. 1. If in a worktree (working directory contains `.claude/worktrees/`), you are already on a feature branch — do NOT create a new one. Otherwise, create a new branch from main with a descriptive name. 2. Stage and commit all changes with a clean, semantic commit message. No Claude attribution lines. -3. Fetch latest main and rebase: `git fetch origin main && git rebase origin/main`. +3. Fetch latest main and rebase: `git fetch gitea main && git rebase gitea/main`. - If conflicts occur, abort the rebase (`git rebase --abort`), analyze the conflicting files, write a plan to resolve them, and present the plan to the user before proceeding. -4. Push the branch to origin with `-u` (use `--force-with-lease` if already pushed). Also push to gitea. -5. Create a GitHub PR: `gh pr create`. Reference related issues with `#X`. Only use `Closes #X` if the PR fully resolves the issue. -6. Create a Gitea PR: `tea pr create --head --base main` with the same title and description. -7. Wait for CI to pass: poll with `gh pr checks` or `gh run watch`. If CI fails, report the failure and stop — do not merge. -8. Once CI passes, squash-merge on GitHub: `gh pr merge --squash` with a clean, semantic commit message including the PR number. No Claude attribution lines. -9. Squash-merge on Gitea: `tea pr merge --style squash` with the same message. -10. Push main to gitea: `git push gitea main`. -11. Clean up remote branches: `git push origin --delete && git push gitea --delete `. -12. Prune refs: `git remote prune origin && git remote prune gitea`. -13. Report both merged PR URLs. +4. Push the branch to both remotes: `git push -u gitea && git push origin ` (use `--force-with-lease` if already pushed). +5. Create a Gitea PR: `tea pr create --head --base main`. Reference related issues with `#X`. Only use `Closes #X` if the PR fully resolves the issue. +6. Wait for CI to pass: poll Gitea CI status. If CI fails, report the failure and stop — do not merge. +7. Once CI passes, squash-merge on Gitea: `tea pr merge --style squash` with a clean, semantic commit message including the PR number. No Claude attribution lines. +8. Update local main and push to both remotes: `git checkout main && git pull gitea main && git push origin main`. +9. Clean up remote branches: `git push gitea --delete && git push origin --delete `. +10. Prune refs: `git remote prune gitea && git remote prune origin`. +11. Report the merged PR URL. diff --git a/.claude/commands/release.md b/.claude/commands/release.md index 6794eac..a9f7cba 100644 --- a/.claude/commands/release.md +++ b/.claude/commands/release.md @@ -1,4 +1,4 @@ -Create a new release for this project. +Create a new release on Gitea. Push tags to both remotes. ## Pre-flight @@ -14,8 +14,7 @@ Create a new release for this project. - **minor**: new features, meaningful new behavior - **patch**: bug fixes, docs, refactoring with no new features Present the proposed version, bump rationale, and commit list. Wait for user approval. -6. Tag the new version. Push the tag to all remotes (origin, gitea). +6. Tag the new version. Push the tag to both remotes: `git push gitea && git push origin `. 7. Generate release notes grouped by type (features, fixes, chores). -8. Create a GitHub release with `gh release create`. -9. Create a Gitea release with `tea releases create` using the same notes. -10. Report both release URLs and confirm all remotes are up to date. +8. Create a Gitea release with `tea releases create` using the notes. +9. Report the release URL and confirm all remotes are up to date. diff --git a/.github/workflows/ci.yml b/.gitea/workflows/ci.yml similarity index 93% rename from .github/workflows/ci.yml rename to .gitea/workflows/ci.yml index e21c1fc..2d9b6c9 100644 --- a/.github/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,9 +8,6 @@ on: branches: - '**' -permissions: - contents: read - jobs: build-test: name: Build and Test diff --git a/CLAUDE.md b/CLAUDE.md index cbbca60..8cd30a1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,7 +7,6 @@ All changes go through PRs: 1. Enter a worktree (`EnterWorktree`) at session start. 2. Make changes, commit with semantic messages. 3. `/pr` to push, open a PR, wait for CI, and squash-merge. - (Or use `/pr-create` and `/pr-merge` separately for more control.) ## Releasing -- 2.49.1