File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : 🪞 Espelhamento para Codeberg
2+
3+ # Executa sempre que houver um push na main ou uma nova tag de versão for criada
4+ on :
5+ push :
6+ branches : [ main ]
7+ tags : [ 'v*' ]
8+
9+ jobs :
10+ mirror :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : 📥 Checkout do código
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0 # Fundamental: puxa todo o histórico, branches e tags
17+
18+ - name : 🚀 Sincronizando com o Codeberg
19+ env :
20+ CODEBERG_TOKEN : ${{ secrets.CODEBERG_TOKEN }}
21+ CODEBERG_USER : " vinicius3w" # ⚠️ Altere para o seu usuário/organização
22+ REPO_NAME : " bisolhador"
23+ run : |
24+ # Configura o git local para não reclamar de credenciais
25+ git config --global user.name "GitHub Action Mirror"
26+ git config --global user.email "action@github.com"
27+
28+ # Adiciona o Codeberg como um remote
29+ git remote add codeberg https://$CODEBERG_USER:$CODEBERG_TOKEN@codeberg.org/$CODEBERG_USER/$REPO_NAME.git
30+
31+ # Empurra todo o histórico e tags forçando a sincronia
32+ git push codeberg --all --force
33+ git push codeberg --tags --force
You can’t perform that action at this time.
0 commit comments