feat(regime)

This commit is contained in:
Dan Finch 2026-04-29 00:55:53 +02:00
commit faacaba2f5
37 changed files with 1060 additions and 0 deletions

55
actions/mirror/action.yml Normal file
View file

@ -0,0 +1,55 @@
name: Mirror to GitHub
description: Mirror the current repo to GitHub, optionally filtering paths listed in .mirrorignore
inputs:
target:
description: "GitHub repo (e.g. owner/repo)"
required: true
source:
description: "Authenticated clone URL for the source repo"
required: true
token:
description: "GitHub personal access token with push access"
required: true
runs:
using: composite
steps:
- name: Install git-filter-repo
shell: bash
run: pip install --break-system-packages git-filter-repo
- name: Clone mirror
shell: bash
run: git clone --bare "$GITHUB_WORKSPACE" /tmp/mirror-repo
- name: Filter ignored paths
shell: bash
run: |
MIRRORIGNORE="$GITHUB_WORKSPACE/.mirrorignore"
if [ ! -f "$MIRRORIGNORE" ]; then
echo "No .mirrorignore found, skipping filter"
exit 0
fi
ARGS=""
while IFS= read -r line || [ -n "$line" ]; do
line="$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
[ -z "$line" ] && continue
[[ "$line" == \#* ]] && continue
ARGS="$ARGS --path $line"
done < "$MIRRORIGNORE"
# Always filter .mirrorignore itself
ARGS="$ARGS --path .mirrorignore"
if [ -n "$ARGS" ]; then
cd /tmp/mirror-repo
git filter-repo $ARGS --invert-paths --force
fi
- name: Push mirror
shell: bash
run: |
cd /tmp/mirror-repo
git push --mirror "https://${{ inputs.token }}@github.com/${{ inputs.target }}.git"