Skip to content

Commit

Permalink
PR-checks / use re-usable misspell action
Browse files Browse the repository at this point in the history
This gives us one central point where to change the misspell & golang
version etc.
  • Loading branch information
JanneKiiskila committed Dec 16, 2024
1 parent bafde4c commit 29bee42
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,9 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
- name: Remove vendor folder
run: rm -rf vendor
- name: Misspell
uses: PelionIoT/actions/.github/actions/misspell@main
with:
go-version: '1.20'

# Need to run this 1st, so that the other log files do not cause unnecessary findings
- name: Run misspell
if: always()
run: |
# Remove the vendor folder - we don't need to check that.
rm -rf vendor
go install github.com/golangci/misspell/cmd/misspell@latest
misspell -i mosquitto . >misspell.log
echo "## Summary" >>$SUMMARY_FILE
echo "### misspell" >>$SUMMARY_FILE
cat misspell.log >>$SUMMARY_FILE
lines=$(wc -l < "misspell.log")
if [[ $lines -gt 0 ]]; then
echo "Misspell has findings, fail."
echo "TEST_FAIL=true" >> $GITHUB_ENV
exit 1
else
echo "No findings." >>$SUMMARY_FILE
fi
- name: Write summary
if: always()
run: cat $SUMMARY_FILE >>$GITHUB_STEP_SUMMARY
exceptions: "mosquitto"

0 comments on commit 29bee42

Please sign in to comment.