Skip to content

Commit c1552f0

Browse files
feat: add GitHub Actions workflow to automatically apply translation suggestions from issues.
1 parent 87b8a37 commit c1552f0

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/apply-translations.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ on:
44
issues:
55
types: [labeled]
66

7+
# ========== FILA AUTOMÁTICA ==========
8+
# Quando várias issues são aprovadas rapidamente, os workflows
9+
# entram numa fila e são executados em sequência (não em paralelo)
10+
concurrency:
11+
group: apply-translations-queue
12+
cancel-in-progress: false # Espera o anterior terminar, NÃO cancela
13+
714
jobs:
815
apply-translations:
916
# Só executa quando a label "approved" é adicionada
@@ -57,7 +64,25 @@ jobs:
5764
Contribuição de @${{ github.event.issue.user.login }}
5865
5966
Co-authored-by: ${{ github.event.issue.user.login }} <${{ github.event.issue.user.id }}+${{ github.event.issue.user.login }}@users.noreply.github.com>"
60-
git push origin dev
67+
68+
# ========== PUSH COM RETRY ==========
69+
# Sincroniza antes do push e tenta 3x com backoff exponencial
70+
for attempt in 1 2 3; do
71+
echo "📤 Tentativa $attempt de push..."
72+
git pull --rebase origin dev 2>/dev/null || true
73+
if git push origin dev; then
74+
echo "✅ Push realizado com sucesso!"
75+
break
76+
else
77+
if [ $attempt -lt 3 ]; then
78+
echo "⚠️ Falha no push, aguardando $((attempt * 2))s..."
79+
sleep $((attempt * 2))
80+
else
81+
echo "❌ Falha após 3 tentativas"
82+
exit 1
83+
fi
84+
fi
85+
done
6186
6287
- name: Close Issue with Success
6388
if: steps.apply.outputs.changes_made == 'true'

0 commit comments

Comments
 (0)