Skip to content

Commit 26fc837

Browse files
authored
ci: check for unused packages
1 parent 3ec2e96 commit 26fc837

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,27 @@ jobs:
181181

182182
- name: Check for unstaged files
183183
run: ./scripts/check_unstaged.sh
184+
185+
- name: Check for unsued npm packages
186+
run: |
187+
depcheck || true
188+
if [ -f unused.json ]; then
189+
echo "Unused dependencies found:"
190+
cat unused.json
191+
echo "Please review and remove these dependencies manually."
192+
exit 1
193+
fi
194+
195+
- name: Check for unsued go packages
196+
run: |
197+
go mod tidy
198+
git diff --exit-code -- go.mod go.sum
199+
if [ $? -ne 0 ]; then
200+
echo "Unused Go dependencies found:"
201+
git diff go.mod go.sum
202+
echo "Please review and remove these dependencies manually."
203+
exit 1
204+
fi
184205
185206
fmt:
186207
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}

0 commit comments

Comments
 (0)