Skip to content

Commit 7e2e0c6

Browse files
committed
fix(workflow): escape shell arithmetic expansion to prevent GitHub Actions parser error
GitHub Actions YAML parser was interpreting shell $(( as potential ${{ expression start. Escaping with $$ fixes the parsing error.
1 parent abb4fd6 commit 7e2e0c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/translate-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ jobs:
225225
PUSH_SUCCESS=false
226226
227227
while [ $RETRY_COUNT -lt $MAX_RETRIES ] && [ "$PUSH_SUCCESS" = false ]; do
228-
CURRENT_ATTEMPT=$((RETRY_COUNT + 1))
228+
CURRENT_ATTEMPT=$$((RETRY_COUNT + 1))
229229
if PUSH_OUTPUT=$(git push origin "${TARGET_BRANCH}" 2>&1); then
230230
PUSH_SUCCESS=true
231231
echo "✅ Push succeeded on attempt $CURRENT_ATTEMPT"
232232
else
233-
RETRY_COUNT=$((RETRY_COUNT + 1))
233+
RETRY_COUNT=$$((RETRY_COUNT + 1))
234234
235235
# Check if error is due to non-fast-forward (push race condition)
236236
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
@@ -245,7 +245,7 @@ jobs:
245245
echo "Rebasing local changes on top of origin/${TARGET_BRANCH}..."
246246
if git rebase "origin/${TARGET_BRANCH}" 2>&1; then
247247
# Calculate exponential backoff: 2^N seconds (2s, 4s, 8s)
248-
BACKOFF_TIME=$((2 ** RETRY_COUNT))
248+
BACKOFF_TIME=$$((2 ** RETRY_COUNT))
249249
echo "Waiting ${BACKOFF_TIME}s before retry..."
250250
sleep $BACKOFF_TIME
251251
else

0 commit comments

Comments
 (0)