-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for make gotidy CI check (#9713)
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This action requires that PRs run `make gotidy` to ensure | ||
# dependencies are up to date in reaction to any changes | ||
|
||
name: gotidy | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
gotidy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check for go mod dependency changes | ||
run: | | ||
make gotidy | ||
if [[ $(git diff --name-only | grep go\.mod) || $(git diff --name-only | grep go\.sum) ]] | ||
then | ||
echo "go.mod/go.sum deps changes detected." | ||
echo "Please run `make gotidy`" | ||
false | ||
else | ||
echo "No go module changes detected." | ||
fi |