32 lines
571 B
YAML
32 lines
571 B
YAML
name: Format
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
pull_request:
|
|
|
|
jobs:
|
|
gofmt:
|
|
name: gofmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Verify formatting
|
|
shell: bash
|
|
run: |
|
|
files="$(gofmt -l .)"
|
|
if [[ -n "${files}" ]]; then
|
|
echo "These files need formatting:"
|
|
echo "${files}"
|
|
exit 1
|
|
fi
|