mirror of
https://github.com/igareck/vpn-configs-for-russia.git
synced 2026-07-04 19:23:01 +00:00
Зеркало / 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:
23
.github/workflows/mirror-to-gitea.yml
vendored
23
.github/workflows/mirror-to-gitea.yml
vendored
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user