Skip to content

Commit de902c2

Browse files
committed
Add a github action that checks for go.mod replace
To catch unwanted local go.mod replace lines to be merged this patch adds a check for it.
1 parent eb3084a commit de902c2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/lints.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Lints
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
check-go-mod-replace-lines:
7+
name: check for replace lines in go.mod files
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout project code
11+
uses: actions/checkout@v3
12+
- name: check for replace lines in go.mod files
13+
run: |
14+
! egrep --invert-match -e '^replace.*/api => \./api|^replace.*//allow-merging$' `find . -name 'go.mod'` | egrep -e 'go.mod:replace'

0 commit comments

Comments
 (0)