Bumps the github-actions group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [actions/setup-node](https://github.com/actions/setup-node), [actions/setup-go](https://github.com/actions/setup-go) and [actions/cache](https://github.com/actions/cache). Updates `actions/checkout` from 6.0.1 to 6.0.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](8e8c483db8...de0fac2e45) Updates `actions/setup-node` from 6.1.0 to 6.2.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](395ad32622...6044e13b5d) Updates `actions/setup-go` from 6.1.0 to 6.2.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](4dc6199c7b...7a3fe6cf4c) Updates `actions/cache` from 5.0.1 to 5.0.2 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](9255dc7a25...8b402f58fb) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/setup-node dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: actions/setup-go dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: actions/cache dependency-version: 5.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Jason Cameron <git@jsn.cam>
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: Go Mod Tidy Check
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
go_mod_tidy_check:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
|
with:
|
|
go-version: '1.25.4'
|
|
|
|
- name: Check go.mod and go.sum in main directory
|
|
run: |
|
|
# Store original file state
|
|
cp go.mod go.mod.orig
|
|
cp go.sum go.sum.orig
|
|
|
|
# Run go mod tidy
|
|
go mod tidy
|
|
|
|
# Check if files changed
|
|
if ! diff -q go.mod.orig go.mod > /dev/null 2>&1; then
|
|
echo "ERROR: go.mod in main directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.mod.orig go.mod
|
|
exit 1
|
|
fi
|
|
|
|
if ! diff -q go.sum.orig go.sum > /dev/null 2>&1; then
|
|
echo "ERROR: go.sum in main directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.sum.orig go.sum
|
|
exit 1
|
|
fi
|
|
|
|
echo "SUCCESS: go.mod and go.sum in main directory are tidy"
|
|
|
|
- name: Check go.mod and go.sum in test directory
|
|
run: |
|
|
cd test
|
|
|
|
# Store original file state
|
|
cp go.mod go.mod.orig
|
|
cp go.sum go.sum.orig
|
|
|
|
# Run go mod tidy
|
|
go mod tidy
|
|
|
|
# Check if files changed
|
|
if ! diff -q go.mod.orig go.mod > /dev/null 2>&1; then
|
|
echo "ERROR: go.mod in test directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.mod.orig go.mod
|
|
exit 1
|
|
fi
|
|
|
|
if ! diff -q go.sum.orig go.sum > /dev/null 2>&1; then
|
|
echo "ERROR: go.sum in test directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.sum.orig go.sum
|
|
exit 1
|
|
fi
|
|
|
|
echo "SUCCESS: go.mod and go.sum in test directory are tidy"
|