mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
Update update-dependencies.yml
This commit is contained in:
parent
e743cd0c25
commit
9af75ed51b
1 changed files with 40 additions and 13 deletions
47
.github/workflows/update-dependencies.yml
vendored
47
.github/workflows/update-dependencies.yml
vendored
|
@ -2,38 +2,65 @@ name: Update Go Dependencies
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 1' # Запуск каждую неделю (понедельник в 00:00 UTC)
|
- cron: '0 0 * * 1' # Запуск каждую неделю в понедельник в 00:00 UTC
|
||||||
workflow_dispatch: # Позволяет запускать вручную
|
workflow_dispatch: # Возможность ручного запуска
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # Явное указание разрешений
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
update:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04 # Используем свежую Ubuntu
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
fetch-depth: 0 # Загружаем всю историю
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Clean Go module cache
|
|
||||||
run: go clean -modcache
|
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
check-latest: true
|
||||||
|
cache: true # Включаем кэширование модулей
|
||||||
|
|
||||||
|
- name: Clean Go module cache
|
||||||
|
run: |
|
||||||
|
go clean -modcache
|
||||||
|
go clean -cache
|
||||||
|
|
||||||
- name: Update dependencies
|
- name: Update dependencies
|
||||||
|
id: update
|
||||||
run: |
|
run: |
|
||||||
go get -u $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -m all | grep -v 'gvisor.dev/gvisor')
|
set -e # Прерываем выполнение при ошибках
|
||||||
|
echo "Updating Go dependencies..."
|
||||||
|
|
||||||
|
# Выводим текущие версии
|
||||||
|
echo "Current versions:"
|
||||||
|
go list -m all
|
||||||
|
|
||||||
|
# Обновляем только объявленные зависимости
|
||||||
|
go get -u ./...
|
||||||
|
|
||||||
|
# Приводим зависимости в порядок
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
go mod verify
|
||||||
|
|
||||||
|
# Выводим обновленные версии
|
||||||
|
echo -e "\nUpdated versions:"
|
||||||
|
go list -m all
|
||||||
|
|
||||||
- name: Check for changes
|
- name: Check for changes
|
||||||
|
id: check
|
||||||
run: |
|
run: |
|
||||||
if ! git diff --exit-code go.mod go.sum; then
|
if git diff --quiet go.mod go.sum; then
|
||||||
echo "changes=true" >> $GITHUB_ENV
|
echo "No dependency changes detected."
|
||||||
else
|
|
||||||
echo "changes=false" >> $GITHUB_ENV
|
echo "changes=false" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Dependency changes detected."
|
||||||
|
echo "changes=true" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
|
|
Loading…
Reference in a new issue