Skip to content

Commit

Permalink
fix: [#15] Add GCI check explicitly to clarify to end-user how to res…
Browse files Browse the repository at this point in the history
…olve it. (#19)
  • Loading branch information
030 committed Jan 24, 2024
1 parent 04c61cd commit 0e33e4d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ runs:
go-version-file: 'go.mod'
cache: false
#
# Check for 'incorrect import order', let pipeline fail if true and provide
# instruction to remediate it. Note: check is included in golangci-lint,
# but it does not provide clarity how to resolve it when positive.
#
- name: gci
shell: bash
run: |
go install github.com/daixiang0/[email protected]
if ~/go/bin/gci list --skip-generated . | grep -q ".*\.go$"; then
echo "One or more 'incorrect import order' detected:"
echo ""
echo "$(~/go/bin/gci diff --skip-generated .)"
echo ""
echo "Resolve it by issuing: '~/go/bin/gci write --skip-generated .'"
exit 1
fi
#
# Code security scanning.
#
- uses: 030/[email protected]
Expand Down

0 comments on commit 0e33e4d

Please sign in to comment.