name: Promote → GitHub # Promotion. Runs on GITEA ONLY. Mirrors ONLY `main` to the public GitHub repo — develop and # feature branches stay Gitea-private (this is why we don't use Gitea's push-mirror, which # would expose every branch). # # Tags are deliberately NOT mirrored. The same `v*` tag means two different things on the two # forges: on Gitea it stages to Verdaccio (`stage.yml`), on GitHub it publishes to npm and # JSR, and a JSR version can never be replaced or removed. Promoting the tag is therefore a # decision a person takes after reading the staging run, not a side effect of creating it: # # git push gh v # # `--tags` is left off the branch push for the same reason. It used to ride along here, which # meant any tag sitting in the runner's clone could reach production as a side effect of # promoting `main` — a publish nobody chose, of a commit nobody was looking at. 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 main to GitHub env: GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }} run: | git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/green-tea.git" git push github "HEAD:refs/heads/main"