-
Notifications
You must be signed in to change notification settings - Fork 52
39 lines (32 loc) · 1.16 KB
/
tidy-go-mod.yaml
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
name: Check if go.mod is tidy
on:
pull_request:
concurrency:
group: "${{ github.workflow }}/${{ github.ref }}"
cancel-in-progress: true
jobs:
check-tidy-go-mod:
name: ensure that go mod tidy has run
runs-on: ubuntu-latest
container:
image: ghcr.io/cloudfoundry/app-autoscaler-release-tools:main@sha256:b0b8601a28a802b6e5fe683147786db536580baf261a0834912ef1dfd0cb7ba1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Trust my checkout
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: run go mod tidy on all .mod's
shell: bash
run: |
#! /usr/bin/env bash
set -eu -o pipefail
make generate-fakes
make generate-openapi-generated-clients-and-servers
make go-mod-tidy
- name: Check if there is any change
id: get_changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Process changes
if: steps.get_changes.outputs.changed != 0
run: |
echo "::error::go.mod is not tidy, run make go-mod-tidy to tidy"
exit 1