mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-08-29 22:36:19 +00:00
49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
name: Update Go Dependencies
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * 1' # Запуск каждую неделю (понедельник в 00:00 UTC)
|
|
workflow_dispatch: # Позволяет запускать вручную
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Clean Go module cache
|
|
run: go clean -modcache
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Update dependencies
|
|
run: |
|
|
# Обновляем все зависимости, кроме gvisor
|
|
go list -m -u all | awk '{print $1}' | grep -v '^gvisor.dev/gvisor$' | xargs go get -u
|
|
|
|
# Принудительно обновляем github.com/xtls/xray-core до последней версии
|
|
go get github.com/xtls/xray-core@latest
|
|
|
|
# Убираем неиспользуемые зависимости и обновляем файлы
|
|
go mod tidy
|
|
|
|
- name: Check for changes
|
|
id: check_changes
|
|
run: |
|
|
git diff --quiet go.mod go.sum || echo "changes=true" >> $GITHUB_ENV
|
|
|
|
- name: Commit and push changes
|
|
if: env.changes == 'true'
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add go.mod go.sum
|
|
git commit -m "chore(deps): update Go dependencies"
|
|
git push origin ${{ github.ref }}
|