@@ -149,6 +149,58 @@ jobs:
149149 status : ${{ job.status }}
150150 webhook-url : ${{ secrets.SLACK_WEBHOOK }}
151151
152+ go-govulncheck :
153+ runs-on : ubuntu-latest
154+
155+ steps :
156+ - uses : actions/checkout@v5
157+
158+ - uses : actions/setup-go@v6
159+ with :
160+ go-version-file : go.mod
161+ cache : true
162+ - run : go install golang.org/x/vuln/cmd/govulncheck@latest
163+
164+ - uses : ruby/setup-ruby@v1
165+ with :
166+ ruby-version : ruby
167+ bundler-cache : true
168+
169+ - name : export CGO_CFLAGS for govulncheck
170+ run : bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
171+ - run : echo $CGO_CFLAGS
172+
173+ - name : export BUILD_TAG for govulncheck
174+ run : echo "BUILD_TAG=$(bundle exec rake go:build_tag)" >> $GITHUB_ENV
175+ - run : echo $BUILD_TAG
176+
177+ # FIXME: Workaround for following error
178+ #
179+ # govulncheck: loading packages: err: exit status 1: stderr: go: inconsistent vendoring in /home/runner/work/go-gem-wrapper/go-gem-wrapper:
180+ # github.com/stretchr/testify@v1.11.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
181+ # github.com/davecgh/go-spew@v1.1.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
182+ # github.com/pmezard/go-difflib@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
183+ # gopkg.in/yaml.v3@v3.0.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
184+ #
185+ # To ignore the vendor directory, use -mod=readonly or -mod=mod.
186+ # To sync the vendor directory, run:
187+ # go mod vendor
188+ - run : rm -rf vendor/
189+
190+ # FIXME: golang/govulncheck-action@v1 doesn't support `-tags` arg
191+ # - uses: golang/govulncheck-action@v1
192+ # with:
193+ # go-version-file: go.mod
194+ - run : govulncheck -format text -tags "${BUILD_TAG}" ./...
195+
196+ - name : Slack Notification (not success)
197+ uses : act10ns/slack@v2
198+ if : " ! success()"
199+ continue-on-error : true
200+ with :
201+ status : ${{ job.status }}
202+ webhook-url : ${{ secrets.SLACK_WEBHOOK }}
203+
152204 ruby-lint :
153205 runs-on : ubuntu-latest
154206
@@ -230,6 +282,7 @@ jobs:
230282 needs :
231283 - build-and-test
232284 - go-lint
285+ - go-govulncheck
233286 - ruby-lint
234287 - ruby-rbs
235288 - go_gem
0 commit comments