feat: mirror
This commit is contained in:
commit
b0f74cb8d9
1 changed files with 36 additions and 0 deletions
36
.forgejo/workflows/mirror.yml
Normal file
36
.forgejo/workflows/mirror.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
name: Reusable Mirror Workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
remote_url:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
force:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: node:20-alpine
|
||||||
|
steps:
|
||||||
|
- name: Instalando dependencias
|
||||||
|
run: |
|
||||||
|
apk add git
|
||||||
|
|
||||||
|
- name: Checkout código
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # ✅ clone completo
|
||||||
|
|
||||||
|
- name: Push branch atual
|
||||||
|
run: |
|
||||||
|
git remote add mirror ${{ inputs.remote_url }}
|
||||||
|
if [ "${{ inputs.force }}" = "true" ]; then
|
||||||
|
git push --force mirror HEAD
|
||||||
|
else
|
||||||
|
git push mirror HEAD
|
||||||
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue