ci(plugins): mirror Gitea main to GitHub main
The public repository exists but nothing populates it. This is the same promotion core uses, cut down to what this repository actually has: one branch. Only `main`, and no `contrib` counterpart. Core mirrors `develop` as `contrib` because outside contributions land there, and that flow is documented. Here it is not, so a second mirrored branch would be a branch nobody targets. Tags stay off the push, `--tags` included. Core's reason was that the same tag means one thing on each forge; here it is simpler and sharper — these packages publish to JSR, and a JSR version can never be replaced or removed, so a tag must never reach the public forge as a side effect of promoting a branch. The push is not forced, and the step fails early with a readable message when GH_PROMOTE_TOKEN is missing rather than building a remote URL with an empty credential and failing on the push with an authentication error instead. Note: that secret is not set on this repository yet. Core carries its own copy. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
2 files changed
+67
-4
No files matched your search
@@ -0,0 +1,44 @@
|
|||||||
|
name: Promote → GitHub
|
||||||
|
|
||||||
|
# Promotion. Runs on GITEA ONLY. Mirrors one branch to the public GitHub repo and nothing else:
|
||||||
|
#
|
||||||
|
# main → GitHub main
|
||||||
|
#
|
||||||
|
# Development happens on `develop` and feature branches, and those stay Gitea-private — which is
|
||||||
|
# why this is a workflow rather than Gitea's push-mirror, since that would expose every branch.
|
||||||
|
#
|
||||||
|
# Only `main`, and no `contrib` counterpart yet: unlike core, this repository has no documented
|
||||||
|
# flow for outside contributions, so there is nothing for a second mirrored branch to serve. Add
|
||||||
|
# one here when that flow exists, rather than shipping a branch nobody targets.
|
||||||
|
#
|
||||||
|
# The push is NOT forced. A refusal means GitHub `main` holds commits that Gitea `main` does not,
|
||||||
|
# which is a question to answer rather than an obstacle to remove.
|
||||||
|
#
|
||||||
|
# Tags are deliberately NOT mirrored, and `--tags` is left off the push for the same reason. These
|
||||||
|
# packages publish to JSR, where a version can never be replaced or removed — so promoting a tag
|
||||||
|
# has to stay a decision someone takes deliberately, never a side effect of promoting a branch.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push-github:
|
||||||
|
if: ${{ github.server_url != 'https://github.com' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # full history for a clean push
|
||||||
|
- name: Push to GitHub
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GH_TOKEN" ]; then
|
||||||
|
echo "::error::GH_PROMOTE_TOKEN is not set on this repository. Add it in Settings → Actions → Secrets; core carries the same secret."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/green-tea-plugins.git"
|
||||||
|
if ! git push github "HEAD:refs/heads/main"; then
|
||||||
|
echo "::error::GitHub main has commits that Gitea main does not. Find out what they are and carry them; never force this push."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -25,10 +25,29 @@ Run all of them before proposing anything as finished. CI runs each one and each
|
|||||||
## Two forges
|
## Two forges
|
||||||
|
|
||||||
Gitea `Green-Tea/plugins` is the origin. `develop` and `main` are protected; everything lands through
|
Gitea `Green-Tea/plugins` is the origin. `develop` and `main` are protected; everything lands through
|
||||||
a pull request. CI still runs on Gitea only, through the `if:` guards in `ci.yml` — but the reason
|
a pull request.
|
||||||
is gone: `@green-tea/core@26.9.0-beta.2` shipped to npmjs.org on 2026-09-22, so the packages no
|
|
||||||
longer need Verdaccio and a GitHub runner can now resolve them. Removing those guards and adding the
|
```
|
||||||
mirror is Plan B3, and it is unblocked rather than done.
|
feature/* → develop → main → [promote.yml] → GitHub main
|
||||||
|
```
|
||||||
|
|
||||||
|
`promote.yml` runs on Gitea only and mirrors `main`, and nothing else. Feature branches and
|
||||||
|
`develop` stay private, which is why this is a workflow rather than Gitea's push-mirror — that
|
||||||
|
would expose every branch. The push is never forced: a refusal means GitHub `main` holds commits
|
||||||
|
Gitea `main` does not, and that is a question to answer, not an obstacle to remove.
|
||||||
|
|
||||||
|
There is **no `contrib` branch** here, unlike core. This repository has no documented flow for
|
||||||
|
outside contributions yet, so there is nothing for a second mirrored branch to serve. Add one when
|
||||||
|
that flow exists rather than shipping a branch nobody targets.
|
||||||
|
|
||||||
|
**Tags are not mirrored.** These packages publish to JSR, where a version can never be replaced or
|
||||||
|
removed, so promoting a tag has to stay a deliberate act rather than a side effect of promoting a
|
||||||
|
branch.
|
||||||
|
|
||||||
|
CI itself still runs on Gitea only, through the `if:` guards in `ci.yml` — but the reason is gone:
|
||||||
|
`@green-tea/core@26.9.0-beta.2` shipped to npmjs.org on 2026-09-22, so the packages no longer need
|
||||||
|
Verdaccio and a GitHub runner can resolve them. Removing those guards is unblocked rather than done,
|
||||||
|
and until it happens the mirrored repository carries workflows that skip every job.
|
||||||
|
|
||||||
## The plugin convention
|
## The plugin convention
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user