feat: mirror to Codeberg via SSH deploy key

Push clean copy (without .forgejo/ and prds/) to Codeberg on
each push to main. Uses SSH deploy key for authentication.

Also bumps kcl-ci to v1.40.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vlad MocanuandClaude Opus 4.6 committed 2026-02-27 16:52:39 +02:00
1 parent 0e082695c9
commit 90a9904e9f
9 files changed
+34 -30

No files matched your search

+1 -1
View File
@@ -4,4 +4,4 @@ edition = "v0.12.3"
version = "0.0.1" version = "0.0.1"
[dependencies] [dependencies]
kcl-ci = { git = "https://git.wxs.ro/actions/kcl-ci", tag = "v1.38.0" } kcl-ci = { git = "https://git.wxs.ro/actions/kcl-ci", tag = "v1.40.0" }
+1 -1
View File
@@ -4,4 +4,4 @@
full_name = "kcl-ci_0.0.1" full_name = "kcl-ci_0.0.1"
version = "0.0.1" version = "0.0.1"
url = "https://git.wxs.ro/actions/kcl-ci" url = "https://git.wxs.ro/actions/kcl-ci"
git_tag = "v1.38.0" git_tag = "v1.40.0"
+3 -1
View File
@@ -669,7 +669,9 @@ fi"""
# Excludes internal CI config and development history # Excludes internal CI config and development history
# ============================================================================= # =============================================================================
_mirror_config = mirror_mod.MirrorBranchConfig { _mirror_config = mirror_mod.MirrorBranchConfig {
target_branch = "codeberg" remote_url = "git@codeberg.org:vtmocanu/claude-code-action.git"
ssh_key_secret = "CODEBERG_MIRROR_SSH_KEY"
ssh_host = "codeberg.org"
exclude_paths = [".forgejo", "prds"] exclude_paths = [".forgejo", "prds"]
paths_ignore = [".forgejo/kcl-ci/**", "prds/**"] paths_ignore = [".forgejo/kcl-ci/**", "prds/**"]
} }
+1 -1
View File
@@ -1,4 +1,4 @@
# Generated by KCL v1.38.0 - DO NOT EDIT # Generated by KCL v1.40.0 - DO NOT EDIT
# Source: .forgejo/kcl-ci/main.k # Source: .forgejo/kcl-ci/main.k
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci # kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci # kcl-ci remote: https://git.wxs.ro/actions/kcl-ci
+1 -1
View File
@@ -1,4 +1,4 @@
# Generated by KCL v1.38.0 - DO NOT EDIT # Generated by KCL v1.40.0 - DO NOT EDIT
# Source: .forgejo/kcl-ci/main.k # Source: .forgejo/kcl-ci/main.k
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci # kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci # kcl-ci remote: https://git.wxs.ro/actions/kcl-ci
+2 -2
View File
@@ -1,4 +1,4 @@
# Generated by KCL v1.38.0 - DO NOT EDIT # Generated by KCL v1.40.0 - DO NOT EDIT
# Source: .forgejo/kcl-ci/main.k # Source: .forgejo/kcl-ci/main.k
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci # kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci # kcl-ci remote: https://git.wxs.ro/actions/kcl-ci
@@ -21,7 +21,7 @@ jobs:
runs-on: grunt runs-on: grunt
steps: steps:
- name: Build KCL workflows - name: Build KCL workflows
uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/actions/kcl-ci@v1.38.0 uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/actions/kcl-ci@v1.40.0
with: with:
read-repo-token: ${{ secrets.READ_REPO_TOKEN }} read-repo-token: ${{ secrets.READ_REPO_TOKEN }}
working-dir: '.forgejo/kcl-ci' working-dir: '.forgejo/kcl-ci'
+23 -21
View File
@@ -1,9 +1,9 @@
# Generated by KCL v1.38.0 - DO NOT EDIT # Generated by KCL v1.40.0 - DO NOT EDIT
# Source: .forgejo/kcl-ci/main.k # Source: .forgejo/kcl-ci/main.k
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci # kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci # kcl-ci remote: https://git.wxs.ro/actions/kcl-ci
name: Mirror Branch name: Mirror to Remote
'on': 'on':
push: push:
branches: branches:
@@ -18,8 +18,8 @@ concurrency:
env: env:
READ_REPO_TOKEN: ${{ secrets.READ_REPO_TOKEN }} READ_REPO_TOKEN: ${{ secrets.READ_REPO_TOKEN }}
jobs: jobs:
update-mirror: push-mirror:
name: Update Mirror Branch name: Push to Mirror
runs-on: grunt runs-on: grunt
steps: steps:
- name: Checkout code - name: Checkout code
@@ -27,28 +27,30 @@ jobs:
with: with:
fetch-depth: '0' fetch-depth: '0'
token: ${{ github.token }} token: ${{ github.token }}
- name: Configure git credentials - name: Configure SSH for mirror
run: |- run: |-
git config --local user.name "forgejo-actions[bot]" mkdir -p ~/.ssh
git config --local user.email "forgejo-actions[bot]@git.wxs.ro" echo "${MIRROR_SSH_KEY}" > ~/.ssh/mirror_key
# Clear checkout action's extraheader (read-only token) chmod 600 ~/.ssh/mirror_key
git config --local --unset-all http.https://git.wxs.ro/.extraheader || true ssh-keyscan codeberg.org >> ~/.ssh/known_hosts 2>/dev/null
# Set remote URL with write token export GIT_SSH_COMMAND="ssh -i ~/.ssh/mirror_key -o StrictHostKeyChecking=no"
git remote set-url origin "https://token:${GITHUB_TOKEN}@git.wxs.ro/${{ github.repository }}.git"
env: env:
GITHUB_TOKEN: ${{ github.token }} MIRROR_SSH_KEY: ${{ secrets.CODEBERG_MIRROR_SSH_KEY }}
- name: Create mirror branch - name: Prepare and push to mirror
run: |- run: |-
# Create or reset the mirror branch from current HEAD
git checkout -B codeberg
# Remove excluded paths # Remove excluded paths
rm -rf .forgejo rm -rf .forgejo
rm -rf prds rm -rf prds
# Commit and force-push # Commit cleaned tree (detached from source history)
git checkout -B mirror-staging
git add -A git add -A
git commit -m "mirror: $(git log -1 --format='%h %s' main) [skip ci]" || echo "No changes to commit" git diff --cached --quiet || git commit -m "mirror: $(git log -1 --format='%h %s' main)"
git push origin codeberg --force
env: # Push to remote via SSH
GITHUB_TOKEN: ${{ github.token }} export GIT_SSH_COMMAND="ssh -i ~/.ssh/mirror_key -o StrictHostKeyChecking=no"
git remote add mirror git@codeberg.org:vtmocanu/claude-code-action.git
git push mirror mirror-staging:main --force
# Cleanup
rm -f ~/.ssh/mirror_key
+1 -1
View File
@@ -1,4 +1,4 @@
# Generated by KCL v1.38.0 - DO NOT EDIT # Generated by KCL v1.40.0 - DO NOT EDIT
# Source: .forgejo/kcl-ci/main.k # Source: .forgejo/kcl-ci/main.k
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci # kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci # kcl-ci remote: https://git.wxs.ro/actions/kcl-ci
+1 -1
View File
@@ -1,4 +1,4 @@
# Generated by KCL v1.38.0 - DO NOT EDIT # Generated by KCL v1.40.0 - DO NOT EDIT
# Source: .forgejo/kcl-ci/main.k # Source: .forgejo/kcl-ci/main.k
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci # kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci # kcl-ci remote: https://git.wxs.ro/actions/kcl-ci