This repository has been archived by the owner on Jun 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Github Action to Check PRs Without Commiting Changes (#1439)
* Use go run instead of installing goimports with go get This prevents goimports related dependencies from being added to go.mod * Change format job to check for diffs without commiting changes * go fmt
- Loading branch information
Showing
9 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
name: Check PR | ||
on: pull_request | ||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2.3.1 | ||
- uses: actions/setup-go@v2.1.0 | ||
with: | ||
go-version: 1.14.4 | ||
- name: gofmt | ||
run: | | ||
DIFFS=$(find -name '*.go' -type f \! -name '*.pb.go' -exec gofmt -s -l {} \+ -o \( -path './vendor' -o -path './third_party' \) -prune) | ||
if [[ -n $DIFFS ]]; then | ||
echo ::error::Diffs reported by gofmt | ||
echo ::group::Files with diffs | ||
echo $DIFFS | ||
echo ::endgroup:: | ||
exit 1 | ||
fi | ||
- name: goimports | ||
run: | | ||
DIFFS=$(find -name '*.go' \! -name wire_gen.go \! -name '*.pb.go' -exec go run golang.org/x/tools/cmd/goimports -l {} \+ -o \( -path ./vendor -o -path ./third_party \) -prune) | ||
if [[ -n $DIFFS ]]; then | ||
echo ::error::Diffs reported by goimports | ||
echo ::group::Files with diffs | ||
echo $DIFFS | ||
echo ::endgroup:: | ||
exit 1 | ||
fi | ||
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
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 |
---|---|---|
|
@@ -44,5 +44,3 @@ func (ss *CloudStorageSourceSpec) SetDefaults(ctx context.Context) { | |
ss.EventTypes = allEventTypes | ||
} | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -80,4 +80,3 @@ func TestCloudStorageSource_SetDefaults(t *testing.T) { | |
}) | ||
} | ||
} | ||
|
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
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
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 |
---|---|---|
|
@@ -71,4 +71,3 @@ func (current *CloudStorageSource) CheckImmutableFields(ctx context.Context, ori | |
} | ||
return nil | ||
} | ||
|
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 |
---|---|---|
|
@@ -37,4 +37,3 @@ func TestTypesImplements(t *testing.T) { | |
} | ||
} | ||
} | ||
|