Skip to content

Commit 1865bec

Browse files
authored
Merge pull request #59 from konflux-ci/gomodtidy
Add GH workflow to check go mod tidy
2 parents 32f2b24 + fa44da1 commit 1865bec

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

.github/workflows/gomod-tidy.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: go mod tidy
2+
3+
"on":
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
gomod-tidy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
20+
with:
21+
go-version-file: go.mod
22+
23+
- name: Check if dependencies are tidy
24+
run: |
25+
#!/bin/bash
26+
set -o errexit -o nounset -o pipefail
27+
28+
go mod tidy
29+
30+
if ! git diff --quiet; then
31+
git diff --color
32+
echo "::error::go mod tidy made changes"
33+
echo "Please run 'go mod tidy' and commit the changes."
34+
exit 1
35+
fi

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ require (
1111
github.com/opencontainers/image-spec v1.1.1
1212
github.com/sirupsen/logrus v1.9.3
1313
github.com/spf13/cobra v1.9.1
14-
oras.land/oras-go/v2 v2.6.0
1514
)
1615

1716
require (
@@ -22,7 +21,6 @@ require (
2221
github.com/onsi/ginkgo/v2 v2.25.1 // indirect
2322
github.com/spf13/pflag v1.0.6 // indirect
2423
golang.org/x/net v0.43.0 // indirect
25-
golang.org/x/sync v0.16.0 // indirect
2624
golang.org/x/sys v0.35.0 // indirect
2725
golang.org/x/text v0.28.0 // indirect
2826
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
5151
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
5252
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
5353
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
54-
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
55-
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
5654
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5755
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
5856
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
@@ -66,5 +64,3 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
6664
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6765
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
6866
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
69-
oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc=
70-
oras.land/oras-go/v2 v2.6.0/go.mod h1:magiQDfG6H1O9APp+rOsvCPcW1GD2MM7vgnKY0Y+u1o=

renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:recommended"
4+
"config:recommended",
5+
"helpers:pinGitHubActionDigestsToSemver"
56
],
67
"packageRules": [
78
{

0 commit comments

Comments
 (0)