Fixed meta fetch #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |