mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-07-01 12:32:09 +00:00
Create update-dependencies.yml
This commit is contained in:
parent
2a364f8c78
commit
dbbb33925c
1 changed files with 43 additions and 0 deletions
43
.github/workflows/update-dependencies.yml
vendored
Normal file
43
.github/workflows/update-dependencies.yml
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
name: Update Go Dependencies
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 1' # Запуск каждую неделю (понедельник в 00:00 UTC)
|
||||
workflow_dispatch: # Позволяет запускать вручную
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Update dependencies
|
||||
run: |
|
||||
go get -u ./...
|
||||
go mod tidy
|
||||
|
||||
- name: Check for changes
|
||||
run: |
|
||||
if ! git diff --exit-code go.mod go.sum; then
|
||||
echo "changes=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "changes=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- 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 }}
|
Loading…
Reference in a new issue