-
Notifications
You must be signed in to change notification settings - Fork 71
47 lines (47 loc) · 1.74 KB
/
tidy.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
47
name: go-mod-tidy
on:
pull_request_target:
types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled]
branches:
- main
jobs:
setup-environment:
runs-on: ubuntu-latest
if: ${{ (github.actor == 'renovate[bot]' || contains(github.event.pull_request.labels.*.name, 'renovatebot')) }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Go
uses: actions/[email protected]
with:
go-version: "1.22"
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: module-cache
uses: actions/cache@v4
with:
path: /home/runner/go/pkg/mod
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Install dependencies
if: steps.module-cache.outputs.cache-hit != 'true'
run: make gomoddownload
- name: Install Tools
if: steps.module-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: go mod tidy, make all
run: |
make tidy && make all
git config user.name opentelemetrybot
git config user.email [email protected]
echo "git diff --exit-code || (git add . && git commit -m \"go mod tidy, make all\" && git push)"
git diff --exit-code || (git add . && git commit -m "go mod tidy, make all" && git push)
env:
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: renovatebot