From ffb65f20e5a8bdf804420e1d18732b8f41d6ec51 Mon Sep 17 00:00:00 2001 From: civisrom <167646351+civisrom@users.noreply.github.com> Date: Tue, 4 Mar 2025 14:37:37 +0300 Subject: [PATCH] Update update-dependencies.yml --- .github/workflows/update-dependencies.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 17879ac9..edfb8fa5 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -1,27 +1,33 @@ name: Update Go Dependencies + on: schedule: - cron: '0 0 * * 1' # Запуск каждую неделю в понедельник в 00:00 UTC workflow_dispatch: # Возможность ручного запуска + permissions: contents: write # Явное указание разрешений + jobs: update: runs-on: ubuntu-latest # Используем последнюю версию Ubuntu timeout-minutes: 30 # Добавляем таймаут для предотвращения зависания + steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 # Загружаем всю историю token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Go uses: actions/setup-go@v5 with: go-version-file: go.mod check-latest: true cache: true # Включаем кэширование модулей + - name: Check go.mod and go.sum exist run: | if [ ! -f go.mod ]; then @@ -34,10 +40,12 @@ jobs: echo "go.sum file not found, initializing it..." go mod tidy fi + - name: Clean Go module cache run: | go clean -modcache go clean -cache + - name: Update dependencies id: update run: | @@ -51,17 +59,12 @@ jobs: grep -v 'github.com/xtls/xray-core' | \ xargs -r go get -u - echo "Specifically updating xray-core to latest release..." - # Получаем последний тег релиза - LATEST_RELEASE=$(curl -s https://api.github.com/repos/xtls/xray-core/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - - # Обновляем xray-core с учетом мажорной версии - go get github.com/xtls/xray-core/v25@$LATEST_RELEASE - + echo "Specifically updating xray-core to latest commit..." + go get github.com/xtls/xray-core@main # Проверяем, какую версию получили echo "Updated xray-core to:" - go list -m github.com/xtls/xray-core/v25 - + go list -m github.com/xtls/xray-core + # Очистка и проверка go mod tidy go mod verify || exit 1 @@ -69,6 +72,7 @@ jobs: # Выводим изменения для лога echo "Updated dependencies:" go list -m all + - name: Check for changes id: check run: | @@ -81,6 +85,7 @@ jobs: # Добавляем || true чтобы предотвратить код ошибки, если grep ничего не находит git diff go.mod || true fi + - name: Commit and push changes if: steps.check.outputs.changes == 'true' run: |