Skip to content

Commit

Permalink
#27 add shared gfmt workflow (#40)
Browse files Browse the repository at this point in the history
* #27 add shared gofmt workflow

* #27 cleanup linting, add pass indicator
  • Loading branch information
kernelsam authored Jul 10, 2023
1 parent f2f513b commit 5843f7f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/gofmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---

name: 'gofmt'

on: [workflow_call]

permissions:
contents: read

jobs:
gofmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: gofmt
run: |
gofmt_out="$(gofmt -s -l .)"
if [ -n "${gofmt_out}" ]; then
echo "[ERROR] Files failing gofmt: "
echo "${gofmt_out}"
exit 1;
else
echo "[INFO] gofmt check passed."
fi

0 comments on commit 5843f7f

Please sign in to comment.