forked from TurboWarp/scratch-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 1.01 KB
/
codeberg.yml
File metadata and controls
37 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: GitHub to Codeberg
on:
push:
delete:
workflow_dispatch: # Allows manual triggering
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config --global user.email "no@thankyou.com"
git config --global user.name "Apple Cat"
- name: Add Codeberg remote
run: git remote add codeberg "https://aec:${{ secrets.CODEBERG_TOKEN }}@codeberg.org/ampmod/scratch-gui.git"
- name: Fetch from Codeberg
run: git fetch codeberg --prune
- name: Mirror to Codeberg
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
git push --mirror codeberg || echo "error"
elif [[ "${{ github.event_name }}" == "delete" ]]; then
git push codeberg --delete ${{ github.ref_name }} || echo "error"
fi
- name: Remove Codeberg remote
run: git remote remove codeberg