ci: sync GitHub pushes to Forgejo
All checks were successful
sync-to-forgejo / sync (push) Successful in 6s

This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-03 18:59:02 +05:30
parent 8b7c178e1c
commit 66953606fb

View file

@ -5,36 +5,34 @@ on:
branches: branches:
- main - main
- high-performance - high-performance
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sync-to-forgejo-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
sync: sync:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Push branch to Forgejo - name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Push to Forgejo
env: env:
FORGEJO_SECRET: ${{ secrets.FORGEJO_SECRET || secrets.GITEA_SECRET }} FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
FORGEJO_OWNER: ${{ secrets.FORGEJO_OWNER || 'ashwin' }}
FORGEJO_USERNAME: ${{ secrets.FORGEJO_USERNAME || secrets.GITEA_USERNAME || 'ashwin' }}
REPO: ${{ github.event.repository.name }}
BRANCH: ${{ github.ref_name }}
run: | run: |
set -euo pipefail set -euo pipefail
test -n "${FORGEJO_SECRET:-}" || { echo "FORGEJO_SECRET is empty"; exit 1; } git remote add forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git" 2>/dev/null || \
git remote set-url forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git"
AUTH="$(printf '%s' "${FORGEJO_USERNAME}:${FORGEJO_SECRET}" | base64 -w0)" git push forgejo "HEAD:${GITHUB_REF#refs/heads/}" --force
TARGET="https://ci.nxtgauge.com/${FORGEJO_OWNER}/${REPO}.git"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote remove forgejo 2>/dev/null || true
git remote add forgejo "${TARGET}"
git -c http.extraHeader="AUTHORIZATION: basic ${AUTH}" push forgejo "HEAD:${BRANCH}" --force
git -c http.extraHeader="AUTHORIZATION: basic ${AUTH}" push forgejo --tags --force