nebula/.github/workflows/gofmt.yml

33 lines
586 B
YAML
Raw Normal View History

name: gofmt
on:
push:
branches:
- master
pull_request:
paths:
- '.github/workflows/gofmt.yml'
- '**.go'
jobs:
gofmt:
name: Run gofmt
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: gofmt
run: |
if [ "$(find . -iname '*.go' | xargs gofmt -l)" ]
then
find . -iname '*.go' | xargs gofmt -d
exit 1
fi