-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.34 KB
/
dep-bump.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Dependency Bump
on:
schedule:
- cron: '1 0 * * 0'
workflow_dispatch:
jobs:
go-get:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.20
- name: Setup git and create branch
env:
GITHUB_TOKEN: ${{ secrets.ADH_BOT_TOKEN }}
run: |
git config --global user.name "adh-bot"
git config --global user.email "[email protected]"
git checkout -b chore/upgrade-dependencies-$(date +%Y-%m-%d)
git push --set-upstream origin chore/upgrade-dependencies-$(date +%Y-%m-%d)
- name: Bump dependencies
run: |
go get -u ./...
go mod tidy
go mod vendor
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.ADH_BOT_TOKEN }}
run: |
# Check if there are changes
if [[ -z $(git status --porcelain) ]]; then
echo "No changes to commit"
exit 0
fi
git add go.mod go.sum
git commit -m "chore(deps): bump dependencies"
git push
gh pr create --title "chore(deps): bump dependencies" --body "Bumps dependencies to latest versions" --base dev --label "dependencies" --reviewer dhawton