-
Notifications
You must be signed in to change notification settings - Fork 12
46 lines (45 loc) · 1.25 KB
/
vendoring.yml
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
45
46
name: Vendoring
on:
pull_request:
types:
- opened
- reopened
jobs:
vendor-job:
name: Vendor
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.21.4'
id: go
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Vendor Dependencies
run: |
go mod tidy
go mod vendor
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
else
git add -A
git config --global user.name "Metric Store Bot"
git config --global user.email "[email protected]"
git commit -m "Updating vendored dependencies"
git push
fi
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['auto-merge']
})