open-consul/.github/workflows/reusable-check-go-mod.yml

29 lines
741 B
YAML

name: check-go-mod
on:
workflow_call:
inputs:
runs-on:
description: An expression indicating which kind of runners to use.
required: true
type: string
jobs:
check-go-mod:
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
- run: go mod tidy
- run: |
if [[ -n $(git status -s) ]]; then
echo "Git directory has changes"
git status -s
exit 1
fi
- name: Notify Slack
if: failure()
run: .github/scripts/notify_slack.sh