Skip to content

Commit

Permalink
chore: what happended to the readlimit file?
Browse files Browse the repository at this point in the history
  • Loading branch information
developStorm committed May 22, 2024
1 parent 3993fe7 commit 7d1c0ef
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,29 @@ jobs:
with:
go-version: 1.18
- name: Run go fmt
id: gofmt
run: |
NON_COMPLIANT_FILES=$(gofmt -s -l $(find . -type f -name '*.go'| grep -v "/.template/"))
if [ -n "$NON_COMPLIANT_FILES" ]; then
echo "The following files are not formatted correctly:"
echo "$NON_COMPLIANT_FILES"
for file in $NON_COMPLIANT_FILES; do
diff -u <(cat $file) <(gofmt -s $file)
done
# format the files
gofmt -s -w $(find . -type f -name '*.go'| grep -v "/.template/")
# put in GITHUB_OUTPUT for next step to upload as an artifact
echo "NON_COMPLIANT_FILES=$NON_COMPLIANT_FILES" >> $GITHUB_OUTPUT
exit 1
fi
- name: Upload non-compliant files as artifact
if: failure()
uses: actions/upload-artifact@v2
with:
name: non-compliant-files
path: ${{ steps.gofmt.outputs.NON_COMPLIANT_FILES }}

0 comments on commit 7d1c0ef

Please sign in to comment.