diff --git a/shared-overwrite/.github/actions/setup/action.yml b/shared-overwrite/.github/actions/setup/action.yml index 52bbd26e..9856ecf1 100644 --- a/shared-overwrite/.github/actions/setup/action.yml +++ b/shared-overwrite/.github/actions/setup/action.yml @@ -54,6 +54,25 @@ runs: # echo "MT_GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV echo "MT_GIT_BRANCH=$MT_GIT_BRANCH" >> $GITHUB_ENV + - name: MT install apt dependencies + shell: bash + run: | + max_attempts=2 + for attempt in $(seq 1 ${max_attempts}); do + echo "[MT] > Installing apt dependencies (attempt ${attempt}/${max_attempts})..." + # can not use '--no-install-recommends' because some of those recommended dependencies are required + if timeout 300 sudo apt-get update && timeout 300 sudo apt-get install -y libxml2-utils jq inkscape imagemagick; then + echo "[MT] > apt dependencies installed successfully." + break + elif [[ ${attempt} -lt ${max_attempts} ]]; then + echo "[MT] > apt dependencies installation failed or timed out, retrying in 5 seconds..." + sleep 5 + else + echo "[MT] > apt dependencies installation failed after ${attempt} attempts." + exit 1 + fi + done + - name: MT code sync shell: bash if: ${{ inputs.code-sync == 'true' }}