Adds a mirror-branch workflow that copies main to a `codeberg` branch excluding .forgejo/ and prds/ directories. Configure Forgejo push mirror on this branch to sync a clean copy to Codeberg. Also picks up updated allowed_tools from kcl-ci (adds bunx/npx patterns). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
# Generated by KCL v1.37.1 - DO NOT EDIT
|
|
# Source: .forgejo/kcl-ci/main.k
|
|
# kcl-ci local: ~/stuff/gitrepos/wxs/actions/kcl-ci
|
|
# kcl-ci remote: https://git.wxs.ro/actions/kcl-ci
|
|
|
|
name: Mirror Branch
|
|
'on':
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '.forgejo/kcl-ci/**'
|
|
- prds/**
|
|
workflow_dispatch: {}
|
|
concurrency:
|
|
group: mirror-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
env:
|
|
READ_REPO_TOKEN: ${{ secrets.READ_REPO_TOKEN }}
|
|
jobs:
|
|
update-mirror:
|
|
name: Update Mirror Branch
|
|
runs-on: grunt
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/xternal/checkout@v6.0.2
|
|
with:
|
|
fetch-depth: '0'
|
|
token: ${{ github.token }}
|
|
- name: Configure git credentials
|
|
run: |-
|
|
git config --local user.name "forgejo-actions[bot]"
|
|
git config --local user.email "forgejo-actions[bot]@git.wxs.ro"
|
|
# Clear checkout action's extraheader (read-only token)
|
|
git config --local --unset-all http.https://git.wxs.ro/.extraheader || true
|
|
# Set remote URL with write token
|
|
git remote set-url origin "https://token:${GITHUB_TOKEN}@git.wxs.ro/${{ github.repository }}.git"
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
- name: Create mirror branch
|
|
run: |-
|
|
# Create or reset the mirror branch from current HEAD
|
|
git checkout -B codeberg
|
|
|
|
# Remove excluded paths
|
|
rm -rf .forgejo
|
|
rm -rf prds
|
|
|
|
# Commit and force-push
|
|
git add -A
|
|
git commit -m "mirror: $(git log -1 --format='%h %s' main) [skip ci]" || echo "No changes to commit"
|
|
git push origin codeberg --force
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|