-
Notifications
You must be signed in to change notification settings - Fork 2.2k
47 lines (45 loc) · 1.89 KB
/
Copy pathtidy-dependencies.yml
File metadata and controls
47 lines (45 loc) · 1.89 KB
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: "Project: Tidy"
on:
pull_request:
types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled]
branches:
- main
permissions: read-all
jobs:
setup-environment:
permissions:
contents: write # for Git to git push
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependency-major-update') && (github.event.pull_request.user.login == 'renovate[bot]' || contains(github.event.pull_request.labels.*.name, 'renovatebot')) && github.event.pull_request.head.repo.fork == false }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.head_ref }}
# Keep token so the `go mod tidy` step can push.
persist-credentials: true # zizmor: ignore[artipacked]
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: oldstable
cache: false
- name: Cache Go
id: go-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.go-cache.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: go mod tidy
run: |
make gotidy
git config user.name otelbot
git config user.email 197425009+otelbot@users.noreply.github.com
echo "git diff --exit-code || (git add . && git commit -m \"go mod tidy\" && git push)"
git diff --exit-code || (git add . && git commit -m "go mod tidy" && git push)
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
with:
labels: renovatebot