Зеркало / Mirror to Gitea

Создание зеркала на Gitea.com
Create a mirror on Gitea.com
This change adds a step to configure Git identity and removes GitHub Actions workflows from the Gitea mirror to prevent execution in the mirrored repository.
This commit is contained in:
Igor Krauch
2026-06-26 11:18:11 -04:00
committed by GitHub
parent 8816c1faee
commit 2a271061cf

View File

@@ -24,15 +24,32 @@ jobs:
with:
fetch-depth: 0
- name: Configure Git identity
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Remove GitHub Actions workflows from Gitea mirror
run: |
set -euo pipefail
# Gitea.com supports GitHub Actions-compatible workflows and may try
# to run .github/workflows/*.yml from the mirrored repository.
# This repository is only a mirror, so workflows must stay only on GitHub.
git rm -rf .github/workflows 2>/dev/null || true
if ! git diff --cached --quiet; then
git commit -m "Remove GitHub Actions workflows from Gitea mirror"
else
echo "No workflow files to remove for Gitea mirror"
fi
- name: Push main branch to Gitea
env:
GITEA_TOKEN: ${{ secrets.GITEA_MIRROR_TOKEN }}
run: |
set -euo pipefail
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git remote remove gitea 2>/dev/null || true
git remote add gitea "https://igareck:${GITEA_TOKEN}@gitea.com/igareck/vpn-configs-for-russia.git"