From 1946a5b1d1e4e48a331b3ab341bf225da7b26a92 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:14:07 -0700 Subject: [PATCH 01/31] Use common workflow --- .github/workflows/go.yml | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 97de53d..95e3670 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,42 +6,8 @@ on: pull_request: jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - go: ['1.18', '1.x'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go }} - id: go - - - name: Build - run: make build - - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.x' - - - name: Test - run: make test - - - name: Send coverage - uses: shogo82148/actions-goveralls@v1 - with: - path-to-profile: profile.cov + go: + uses: openconfig/common-ci/.github/workflows/basic_go.yml@0dea8d1 generate: runs-on: ubuntu-latest From 724fbcef1a7922fc568e44cd70492e253c2e6374 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:14:58 -0700 Subject: [PATCH 02/31] fix file name --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 95e3670..c53feb6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@0dea8d1 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0dea8d1 generate: runs-on: ubuntu-latest From 7288bad19292064abebfb862794a981196879c2a Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:16:05 -0700 Subject: [PATCH 03/31] debug --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c53feb6..c013864 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0dea8d1 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@basic_go_workflow generate: runs-on: ubuntu-latest From 3d05377a54c8102192e9463161ca9b0fa5b28b4b Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:16:29 -0700 Subject: [PATCH 04/31] debug --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c013864..d180c00 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@basic_go_workflow + uses: openconfig/common-ci/.github/workflows/basic_go.yml@6157015 generate: runs-on: ubuntu-latest From 1fc1001a80cc6febb510066da29c4a2f81e37125 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:19:34 -0700 Subject: [PATCH 05/31] debug --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d180c00..0078e21 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@6157015 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@6157015cd23f027e72722a8a54c5e8d50875f9dc generate: runs-on: ubuntu-latest From 75ba691f6f8784321971d5c8b2865febc054a642 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:23:38 -0700 Subject: [PATCH 06/31] gofmt --- .github/workflows/go.yml | 2 +- exampleoc/enum_map.go | 2 +- exampleoc/gen.sh | 1 + internal/exampleocunordered/enum_map.go | 2 +- internal/exampleocunordered/gen.sh | 1 + internal/uexampleoc/enum_map.go | 4 ++-- internal/uexampleoc/gen.sh | 1 + 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0078e21..55d23b9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@6157015cd23f027e72722a8a54c5e8d50875f9dc + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0ef57c0b791d1097550176ae6bdf6829bf805643 generate: runs-on: ubuntu-latest diff --git a/exampleoc/enum_map.go b/exampleoc/enum_map.go index 54906fd..8e426bf 100644 --- a/exampleoc/enum_map.go +++ b/exampleoc/enum_map.go @@ -51,7 +51,7 @@ var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ // of the map ensures that there are no clashes with valid YANG identifiers. func initΛEnumTypes() { ΛEnumTypes = map[string][]reflect.Type{ - "/parent/child/state/three": []reflect.Type{ + "/parent/child/state/three": { reflect.TypeOf((E_Child_Three)(0)), }, } diff --git a/exampleoc/gen.sh b/exampleoc/gen.sh index 05e90ca..59ee1ac 100755 --- a/exampleoc/gen.sh +++ b/exampleoc/gen.sh @@ -29,4 +29,5 @@ go run ../app/ygnmi generator \ go install golang.org/x/tools/cmd/goimports@latest go install github.com/google/addlicense@latest goimports -w . +gofmt -w -s . addlicense -c "Google LLC" -y "2023" -l apache . diff --git a/internal/exampleocunordered/enum_map.go b/internal/exampleocunordered/enum_map.go index 1deeb0f..81fe712 100644 --- a/internal/exampleocunordered/enum_map.go +++ b/internal/exampleocunordered/enum_map.go @@ -51,7 +51,7 @@ var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ // of the map ensures that there are no clashes with valid YANG identifiers. func initΛEnumTypes() { ΛEnumTypes = map[string][]reflect.Type{ - "/parent/child/state/three": []reflect.Type{ + "/parent/child/state/three": { reflect.TypeOf((E_Child_Three)(0)), }, } diff --git a/internal/exampleocunordered/gen.sh b/internal/exampleocunordered/gen.sh index 78e363f..5da6686 100755 --- a/internal/exampleocunordered/gen.sh +++ b/internal/exampleocunordered/gen.sh @@ -29,4 +29,5 @@ go run ../../app/ygnmi generator \ go install golang.org/x/tools/cmd/goimports@latest go install github.com/google/addlicense@latest goimports -w . +gofmt -w -s . addlicense -c "Google LLC" -y "2022" -l apache . diff --git a/internal/uexampleoc/enum_map.go b/internal/uexampleoc/enum_map.go index 15fefba..be15bf2 100644 --- a/internal/uexampleoc/enum_map.go +++ b/internal/uexampleoc/enum_map.go @@ -51,10 +51,10 @@ var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ // of the map ensures that there are no clashes with valid YANG identifiers. func initΛEnumTypes() { ΛEnumTypes = map[string][]reflect.Type{ - "/parent/child/config/three": []reflect.Type{ + "/parent/child/config/three": { reflect.TypeOf((E_Simple_Parent_Child_Config_Three)(0)), }, - "/parent/child/state/three": []reflect.Type{ + "/parent/child/state/three": { reflect.TypeOf((E_Simple_Parent_Child_Config_Three)(0)), }, } diff --git a/internal/uexampleoc/gen.sh b/internal/uexampleoc/gen.sh index ad2876d..f461ab0 100755 --- a/internal/uexampleoc/gen.sh +++ b/internal/uexampleoc/gen.sh @@ -29,4 +29,5 @@ go run ../../app/ygnmi generator \ go install golang.org/x/tools/cmd/goimports@latest go install github.com/google/addlicense@latest goimports -w . +gofmt -w -s . addlicense -c "Google LLC" -y "2023" -l apache . From bff8b2f363be75788e81cbad3d7a6ac962f3ca0f Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:24:22 -0700 Subject: [PATCH 07/31] try direct uses --- .github/workflows/go.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 55d23b9..d43e099 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,8 +6,7 @@ on: pull_request: jobs: - go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0ef57c0b791d1097550176ae6bdf6829bf805643 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0ef57c0b791d1097550176ae6bdf6829bf805643 generate: runs-on: ubuntu-latest From d49273e42ac4a29536cba759a649916c30cd703c Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:25:52 -0700 Subject: [PATCH 08/31] revert --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d43e099..b704a7a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,7 +6,8 @@ on: pull_request: jobs: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0ef57c0b791d1097550176ae6bdf6829bf805643 + Go: + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0ef57c0b791d1097550176ae6bdf6829bf805643 generate: runs-on: ubuntu-latest From d34241a9fee4d766166ea00c20b7ec2e7854cfa7 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:45:11 -0700 Subject: [PATCH 09/31] Try with exclude flag --- .github/workflows/go.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b704a7a..a4709f3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,9 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@0ef57c0b791d1097550176ae6bdf6829bf805643 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@06efad828196a069822048a39a125410086c6d13 + with: + static-analysis-excludes-regex: exampleoc generate: runs-on: ubuntu-latest From ad187bcf3e89f4d3b6c52f8c7552fa8e6b11e17c Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:49:15 -0700 Subject: [PATCH 10/31] try --- .github/workflows/go.yml | 2 +- exampleoc/enum_map.go | 2 +- exampleoc/gen.sh | 1 - internal/exampleocunordered/enum_map.go | 2 +- internal/exampleocunordered/gen.sh | 1 - internal/uexampleoc/enum_map.go | 4 ++-- internal/uexampleoc/gen.sh | 1 - 7 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a4709f3..459f640 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@06efad828196a069822048a39a125410086c6d13 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@7b40a8a3f5db3c6307a34790b99c447bb0798b2f with: static-analysis-excludes-regex: exampleoc diff --git a/exampleoc/enum_map.go b/exampleoc/enum_map.go index 8e426bf..54906fd 100644 --- a/exampleoc/enum_map.go +++ b/exampleoc/enum_map.go @@ -51,7 +51,7 @@ var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ // of the map ensures that there are no clashes with valid YANG identifiers. func initΛEnumTypes() { ΛEnumTypes = map[string][]reflect.Type{ - "/parent/child/state/three": { + "/parent/child/state/three": []reflect.Type{ reflect.TypeOf((E_Child_Three)(0)), }, } diff --git a/exampleoc/gen.sh b/exampleoc/gen.sh index 59ee1ac..05e90ca 100755 --- a/exampleoc/gen.sh +++ b/exampleoc/gen.sh @@ -29,5 +29,4 @@ go run ../app/ygnmi generator \ go install golang.org/x/tools/cmd/goimports@latest go install github.com/google/addlicense@latest goimports -w . -gofmt -w -s . addlicense -c "Google LLC" -y "2023" -l apache . diff --git a/internal/exampleocunordered/enum_map.go b/internal/exampleocunordered/enum_map.go index 81fe712..1deeb0f 100644 --- a/internal/exampleocunordered/enum_map.go +++ b/internal/exampleocunordered/enum_map.go @@ -51,7 +51,7 @@ var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ // of the map ensures that there are no clashes with valid YANG identifiers. func initΛEnumTypes() { ΛEnumTypes = map[string][]reflect.Type{ - "/parent/child/state/three": { + "/parent/child/state/three": []reflect.Type{ reflect.TypeOf((E_Child_Three)(0)), }, } diff --git a/internal/exampleocunordered/gen.sh b/internal/exampleocunordered/gen.sh index 5da6686..78e363f 100755 --- a/internal/exampleocunordered/gen.sh +++ b/internal/exampleocunordered/gen.sh @@ -29,5 +29,4 @@ go run ../../app/ygnmi generator \ go install golang.org/x/tools/cmd/goimports@latest go install github.com/google/addlicense@latest goimports -w . -gofmt -w -s . addlicense -c "Google LLC" -y "2022" -l apache . diff --git a/internal/uexampleoc/enum_map.go b/internal/uexampleoc/enum_map.go index be15bf2..15fefba 100644 --- a/internal/uexampleoc/enum_map.go +++ b/internal/uexampleoc/enum_map.go @@ -51,10 +51,10 @@ var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ // of the map ensures that there are no clashes with valid YANG identifiers. func initΛEnumTypes() { ΛEnumTypes = map[string][]reflect.Type{ - "/parent/child/config/three": { + "/parent/child/config/three": []reflect.Type{ reflect.TypeOf((E_Simple_Parent_Child_Config_Three)(0)), }, - "/parent/child/state/three": { + "/parent/child/state/three": []reflect.Type{ reflect.TypeOf((E_Simple_Parent_Child_Config_Three)(0)), }, } diff --git a/internal/uexampleoc/gen.sh b/internal/uexampleoc/gen.sh index f461ab0..ad2876d 100755 --- a/internal/uexampleoc/gen.sh +++ b/internal/uexampleoc/gen.sh @@ -29,5 +29,4 @@ go run ../../app/ygnmi generator \ go install golang.org/x/tools/cmd/goimports@latest go install github.com/google/addlicense@latest goimports -w . -gofmt -w -s . addlicense -c "Google LLC" -y "2023" -l apache . From 7c57099abb8f06537e2bc90df61da84625dbf81d Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 11:54:46 -0700 Subject: [PATCH 11/31] debug --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 459f640..2f6d18b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@7b40a8a3f5db3c6307a34790b99c447bb0798b2f + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@dbfbea20ede9f45830f57eaf09a3e561ef17e6ab with: static-analysis-excludes-regex: exampleoc From efb19698b1a795287e85d315ecc4c7867a11d255 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 12:09:36 -0700 Subject: [PATCH 12/31] add gofmt excludes regex --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2f6d18b..30cbb46 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,9 +7,10 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@dbfbea20ede9f45830f57eaf09a3e561ef17e6ab + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@4bb3b86b93564b2fa20bfebd5c62d4df9aee2158 with: static-analysis-excludes-regex: exampleoc + gofmt-excludes-regex: exampleoc|internal$ generate: runs-on: ubuntu-latest From ee8296bb16f3579ac02495833b8192e2da5a55f5 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 12:20:24 -0700 Subject: [PATCH 13/31] attempt --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 30cbb46..6186e4b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,10 +7,10 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@4bb3b86b93564b2fa20bfebd5c62d4df9aee2158 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@60051ffd1cf85ae625abb828d1beb754c1461073 with: static-analysis-excludes-regex: exampleoc - gofmt-excludes-regex: exampleoc|internal$ + skip-gofmt: true generate: runs-on: ubuntu-latest From b89f880d46fc149e86e080f3a6e0435534e27f5f Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 12:22:10 -0700 Subject: [PATCH 14/31] attempt --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6186e4b..4b0cb72 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@60051ffd1cf85ae625abb828d1beb754c1461073 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@975b88475ea1efbd8d602a5e2082c8b2509b95c3 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From fe723e9caf09fe2eea1092de0e0488fe06bff5f8 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 12:26:00 -0700 Subject: [PATCH 15/31] attempt --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4b0cb72..900a7bf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@975b88475ea1efbd8d602a5e2082c8b2509b95c3 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@1588717909895a8e846e02b265e991dc4848313d with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 0671b647d3aeddda184e8e45c93c7ffb255f4138 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 13:12:23 -0700 Subject: [PATCH 16/31] Add negation --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 900a7bf..c34c85f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@1588717909895a8e846e02b265e991dc4848313d + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@b3a0f9335d26be116eed35623d614e90fbcf0700 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From c13073f8d563b25d251fc7cb113ed92ac6818509 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 14:13:32 -0700 Subject: [PATCH 17/31] Attempt --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c34c85f..d1e815e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,10 +7,11 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@b3a0f9335d26be116eed35623d614e90fbcf0700 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@c73dd6c4987a4ba5c32ab1fef5c2a02049cebc14 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true + skip-staticcheck: true generate: runs-on: ubuntu-latest From 768c7a422d7c1c2efe631498cf651a9c95e79ef7 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 14:47:43 -0700 Subject: [PATCH 18/31] use newest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d1e815e..0a47410 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@c73dd6c4987a4ba5c32ab1fef5c2a02049cebc14 + uses: openconfig/common-ci/.github/workflows/basic_go.yaml@142ef47ca12d6a5da8e77cc0ef4dff9ffcd0a781 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From a8e078970304b1a2dfea8be2bbbaecf37be17be4 Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 7 Aug 2023 14:49:58 -0700 Subject: [PATCH 19/31] update name --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0a47410..9d8baa0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,8 +6,8 @@ on: pull_request: jobs: - Go: - uses: openconfig/common-ci/.github/workflows/basic_go.yaml@142ef47ca12d6a5da8e77cc0ef4dff9ffcd0a781 + common: + uses: openconfig/common-ci/.github/workflows/basic_go.yml@142ef47ca12d6a5da8e77cc0ef4dff9ffcd0a781 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From b4844a87d6c804f49e161c0910d5e77f505c161f Mon Sep 17 00:00:00 2001 From: wenovus Date: Tue, 8 Aug 2023 09:35:49 -0700 Subject: [PATCH 20/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9d8baa0..a2877d8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: common: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@142ef47ca12d6a5da8e77cc0ef4dff9ffcd0a781 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@97d0e02bb9b9449f8a4df5ce3997840216ff9f5f with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From bd9e42bda9d4ef15abf898ce34a2543d02d74576 Mon Sep 17 00:00:00 2001 From: wenovus Date: Tue, 8 Aug 2023 10:29:11 -0700 Subject: [PATCH 21/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a2877d8..7185bfc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: common: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@97d0e02bb9b9449f8a4df5ce3997840216ff9f5f + uses: openconfig/common-ci/.github/workflows/basic_go.yml@a15d6e11d299a16b14d461eec9c16a745b8f820f with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 8970f342e638a3f6d3f6684e5c1e0d3ebad9d8f6 Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 09:03:54 -0700 Subject: [PATCH 22/31] Use new workflow --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7185bfc..d261022 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: common: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@a15d6e11d299a16b14d461eec9c16a745b8f820f + uses: openconfig/common-ci/.github/workflows/basic_go.yml@22257b2f9de1718ef7ce69e9e58d58f5f1a81e4e with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 7981321e09d7f4e114ae213a9a1836955146e89a Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 09:26:04 -0700 Subject: [PATCH 23/31] use latest --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d261022..fe919c9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,8 +6,8 @@ on: pull_request: jobs: - common: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@22257b2f9de1718ef7ce69e9e58d58f5f1a81e4e + go: + uses: openconfig/common-ci/.github/workflows/basic_go.yml@e83596f1c217a055744a49a584223cecee7c0891 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 3f98320e9e304689b8da9d3161252030370af8d8 Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 10:38:50 -0700 Subject: [PATCH 24/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fe919c9..3a6edf2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@e83596f1c217a055744a49a584223cecee7c0891 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@8f9edbc8f21b959a33a8a102352afde0f0061e69 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From bf61806a7f852ad477495e6a18298c90601ee9c3 Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 10:57:25 -0700 Subject: [PATCH 25/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3a6edf2..510efc7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@8f9edbc8f21b959a33a8a102352afde0f0061e69 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@acc15986a7611306329c6c9deded8cd70603173b with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 25e3c935345c0bdf686944083f0d1e38a8b9e56b Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 12:17:50 -0700 Subject: [PATCH 26/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 510efc7..fef20ac 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@acc15986a7611306329c6c9deded8cd70603173b + uses: openconfig/common-ci/.github/workflows/basic_go.yml@41d1f089c99a3096d3d2ed79598d8597310e12ea with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 3a6204315fb4e2403257e571637012fac83a3769 Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 13:11:54 -0700 Subject: [PATCH 27/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fef20ac..04e1dc6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@41d1f089c99a3096d3d2ed79598d8597310e12ea + uses: openconfig/common-ci/.github/workflows/basic_go.yml@8293f7576627e156df8189b5ea4945ead6da9b0d with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From 52590487b4f44dcaadb9a916b9cc85df5aa012fe Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 13:35:39 -0700 Subject: [PATCH 28/31] use latest --- .github/linters/.gitleaks.toml | 179 +++++++++++++++++++++++++++++++++ .github/linters/.golangci.yml | 53 ++++++++++ .github/linters/.yaml-lint.yml | 59 +++++++++++ .github/workflows/go.yml | 5 +- .github/workflows/lint.yml | 22 ---- 5 files changed, 295 insertions(+), 23 deletions(-) create mode 100644 .github/linters/.gitleaks.toml create mode 100644 .github/linters/.golangci.yml create mode 100644 .github/linters/.yaml-lint.yml delete mode 100644 .github/workflows/lint.yml diff --git a/.github/linters/.gitleaks.toml b/.github/linters/.gitleaks.toml new file mode 100644 index 0000000..150012a --- /dev/null +++ b/.github/linters/.gitleaks.toml @@ -0,0 +1,179 @@ + +title = "gitleaks config" + +[[rules]] + description = "AWS Access Key" + regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' + tags = ["key", "AWS"] + +[[rules]] + description = "AWS Secret Key" + regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]''' + tags = ["key", "AWS"] + +[[rules]] + description = "AWS MWS key" + regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' + tags = ["key", "AWS", "MWS"] + +[[rules]] + description = "Facebook Secret Key" + regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]''' + tags = ["key", "Facebook"] + +[[rules]] + description = "Facebook Client ID" + regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]''' + tags = ["key", "Facebook"] + +[[rules]] + description = "Twitter Secret Key" + regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]''' + tags = ["key", "Twitter"] + +[[rules]] + description = "Twitter Client ID" + regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]''' + tags = ["client", "Twitter"] + +[[rules]] + description = "Github Personal Access Token" + regex = '''ghp_[0-9a-zA-Z]{36}''' + tags = ["key", "Github"] +[[rules]] + description = "Github OAuth Access Token" + regex = '''gho_[0-9a-zA-Z]{36}''' + tags = ["key", "Github"] +[[rules]] + description = "Github App Token" + regex = '''(ghu|ghs)_[0-9a-zA-Z]{36}''' + tags = ["key", "Github"] +[[rules]] + description = "Github Refresh Token" + regex = '''ghr_[0-9a-zA-Z]{76}''' + tags = ["key", "Github"] + +[[rules]] + description = "LinkedIn Client ID" + regex = '''(?i)linkedin(.{0,20})?(?-i)[0-9a-z]{12}''' + tags = ["client", "LinkedIn"] + +[[rules]] + description = "LinkedIn Secret Key" + regex = '''(?i)linkedin(.{0,20})?[0-9a-z]{16}''' + tags = ["secret", "LinkedIn"] + +[[rules]] + description = "Slack" + regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?''' + tags = ["key", "Slack"] + +[[rules]] + description = "Asymmetric Private Key" + regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----''' + tags = ["key", "AsymmetricPrivateKey"] + +[[rules]] + description = "Google API key" + regex = '''AIza[0-9A-Za-z\\-_]{35}''' + tags = ["key", "Google"] + +[[rules]] + description = "Google (GCP) Service Account" + regex = '''"type": "service_account"''' + tags = ["key", "Google"] + +[[rules]] + description = "Heroku API key" + regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' + tags = ["key", "Heroku"] + +[[rules]] + description = "MailChimp API key" + regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}''' + tags = ["key", "Mailchimp"] + +[[rules]] + description = "Mailgun API key" + regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}''' + tags = ["key", "Mailgun"] + +[[rules]] + description = "PayPal Braintree access token" + regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}''' + tags = ["key", "Paypal"] + +[[rules]] + description = "Picatic API key" + regex = '''sk_live_[0-9a-z]{32}''' + tags = ["key", "Picatic"] + +[[rules]] + description = "SendGrid API Key" + regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}''' + tags = ["key", "SendGrid"] + +[[rules]] + description = "Slack Webhook" + regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8,12}/[a-zA-Z0-9_]{24}''' + tags = ["key", "slack"] + +[[rules]] + description = "Stripe API key" + regex = '''(?i)stripe(.{0,20})?[sr]k_live_[0-9a-zA-Z]{24}''' + tags = ["key", "Stripe"] + +[[rules]] + description = "Square access token" + regex = '''sq0atp-[0-9A-Za-z\-_]{22}''' + tags = ["key", "square"] + +[[rules]] + description = "Square OAuth secret" + regex = '''sq0csp-[0-9A-Za-z\\-_]{43}''' + tags = ["key", "square"] + +[[rules]] + description = "Twilio API key" + regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}''' + tags = ["key", "twilio"] + +[[rules]] + description = "Dynatrace ttoken" + regex = '''dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}''' + tags = ["key", "Dynatrace"] + +[[rules]] + description = "Shopify shared secret" + regex = '''shpss_[a-fA-F0-9]{32}''' + tags = ["key", "Shopify"] + +[[rules]] + description = "Shopify access token" + regex = '''shpat_[a-fA-F0-9]{32}''' + tags = ["key", "Shopify"] + +[[rules]] + description = "Shopify custom app access token" + regex = '''shpca_[a-fA-F0-9]{32}''' + tags = ["key", "Shopify"] + +[[rules]] + description = "Shopify private app access token" + regex = '''shppa_[a-fA-F0-9]{32}''' + tags = ["key", "Shopify"] + +[[rules]] + description = "PyPI upload token" + regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}''' + tags = ["key", "pypi"] + +[allowlist] + description = "Allowlisted files" + paths = [ + '''^\.?gitleaks.toml$''', + '''topo/node/srl/generate_certificate_success$''', # exclude dummy test file with random cert + '''(.*?)super-linter.log$''', # exclude linter logs which might contain past errored runs with keys/certs + '''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''', + '''(go.mod|go.sum)$''' + ] \ No newline at end of file diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml new file mode 100644 index 0000000..dca2af2 --- /dev/null +++ b/.github/linters/.golangci.yml @@ -0,0 +1,53 @@ +--- +######################### +######################### +## Golang Linter rules ## +######################### +######################### + +# configure golangci-lint +# see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml +run: + timeout: 10m +issues: + exclude-rules: + - path: _test\.go + linters: + - dupl + - gosec + - goconst + new: true +linters: + enable: + - gosec + - unconvert + - goconst + - goimports + - gofmt + - gocritic + - govet + - revive + - staticcheck + - unconvert + - unparam + - unused + - wastedassign + - whitespace +linters-settings: + errcheck: + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; + # default is false: such cases aren't reported by default. + check-blank: true + govet: + # report about shadowed variables + check-shadowing: false + maligned: + # print struct with more effective memory layout or not, false by default + suggest-new: true + gocritic: + disabled-checks: + - singleCaseSwitch + - appendAssign + revive: + ignore-generated-header: true + severity: warning diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 0000000..e9ec8be --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,59 @@ +--- +########################################### +# These are the rules used for # +# linting all the yaml files in the stack # +# NOTE: # +# You can disable line with: # +# # yamllint disable-line # +########################################### +rules: + braces: + level: warning + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: 1 + max-spaces-inside-empty: 5 + brackets: + level: warning + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: 1 + max-spaces-inside-empty: 5 + colons: + level: warning + max-spaces-before: 0 + max-spaces-after: 1 + commas: + level: warning + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: disable + comments-indentation: disable + document-end: disable + document-start: + level: warning + present: true + empty-lines: + level: warning + max: 2 + max-start: 0 + max-end: 0 + hyphens: + level: warning + max-spaces-after: 1 + indentation: + level: warning + spaces: consistent + indent-sequences: true + check-multi-line-strings: false + key-duplicates: enable + line-length: + level: warning + max: 120 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + new-line-at-end-of-file: disable + new-lines: + type: unix + trailing-spaces: disable diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 04e1dc6..a112af0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,12 +7,15 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@8293f7576627e156df8189b5ea4945ead6da9b0d + uses: openconfig/common-ci/.github/workflows/go.yml@a0a686b0792f164c0cf587825fd742223abe9dc1 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true skip-staticcheck: true + linter: + uses: openconfig/common-ci/.github/workflows/linter.yml@a0a686b0792f164c0cf587825fd742223abe9dc1 + generate: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 3674e08..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: golangci-lint -on: - push: - branches: - - main - pull_request: -permissions: - contents: read -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v3 - with: - go-version: '1.x' - - uses: actions/checkout@v3 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest - only-new-issues: true From 2741ac31e027a97e07a12e9a6aaa24288e23187d Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 9 Aug 2023 13:44:39 -0700 Subject: [PATCH 29/31] Revert --- .github/linters/.gitleaks.toml | 179 --------------------------------- .github/linters/.golangci.yml | 53 ---------- .github/linters/.yaml-lint.yml | 59 ----------- .github/workflows/go.yml | 5 +- .github/workflows/lint.yml | 22 ++++ 5 files changed, 23 insertions(+), 295 deletions(-) delete mode 100644 .github/linters/.gitleaks.toml delete mode 100644 .github/linters/.golangci.yml delete mode 100644 .github/linters/.yaml-lint.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/linters/.gitleaks.toml b/.github/linters/.gitleaks.toml deleted file mode 100644 index 150012a..0000000 --- a/.github/linters/.gitleaks.toml +++ /dev/null @@ -1,179 +0,0 @@ - -title = "gitleaks config" - -[[rules]] - description = "AWS Access Key" - regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' - tags = ["key", "AWS"] - -[[rules]] - description = "AWS Secret Key" - regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]''' - tags = ["key", "AWS"] - -[[rules]] - description = "AWS MWS key" - regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' - tags = ["key", "AWS", "MWS"] - -[[rules]] - description = "Facebook Secret Key" - regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]''' - tags = ["key", "Facebook"] - -[[rules]] - description = "Facebook Client ID" - regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]''' - tags = ["key", "Facebook"] - -[[rules]] - description = "Twitter Secret Key" - regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]''' - tags = ["key", "Twitter"] - -[[rules]] - description = "Twitter Client ID" - regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]''' - tags = ["client", "Twitter"] - -[[rules]] - description = "Github Personal Access Token" - regex = '''ghp_[0-9a-zA-Z]{36}''' - tags = ["key", "Github"] -[[rules]] - description = "Github OAuth Access Token" - regex = '''gho_[0-9a-zA-Z]{36}''' - tags = ["key", "Github"] -[[rules]] - description = "Github App Token" - regex = '''(ghu|ghs)_[0-9a-zA-Z]{36}''' - tags = ["key", "Github"] -[[rules]] - description = "Github Refresh Token" - regex = '''ghr_[0-9a-zA-Z]{76}''' - tags = ["key", "Github"] - -[[rules]] - description = "LinkedIn Client ID" - regex = '''(?i)linkedin(.{0,20})?(?-i)[0-9a-z]{12}''' - tags = ["client", "LinkedIn"] - -[[rules]] - description = "LinkedIn Secret Key" - regex = '''(?i)linkedin(.{0,20})?[0-9a-z]{16}''' - tags = ["secret", "LinkedIn"] - -[[rules]] - description = "Slack" - regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?''' - tags = ["key", "Slack"] - -[[rules]] - description = "Asymmetric Private Key" - regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----''' - tags = ["key", "AsymmetricPrivateKey"] - -[[rules]] - description = "Google API key" - regex = '''AIza[0-9A-Za-z\\-_]{35}''' - tags = ["key", "Google"] - -[[rules]] - description = "Google (GCP) Service Account" - regex = '''"type": "service_account"''' - tags = ["key", "Google"] - -[[rules]] - description = "Heroku API key" - regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' - tags = ["key", "Heroku"] - -[[rules]] - description = "MailChimp API key" - regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}''' - tags = ["key", "Mailchimp"] - -[[rules]] - description = "Mailgun API key" - regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}''' - tags = ["key", "Mailgun"] - -[[rules]] - description = "PayPal Braintree access token" - regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}''' - tags = ["key", "Paypal"] - -[[rules]] - description = "Picatic API key" - regex = '''sk_live_[0-9a-z]{32}''' - tags = ["key", "Picatic"] - -[[rules]] - description = "SendGrid API Key" - regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}''' - tags = ["key", "SendGrid"] - -[[rules]] - description = "Slack Webhook" - regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8,12}/[a-zA-Z0-9_]{24}''' - tags = ["key", "slack"] - -[[rules]] - description = "Stripe API key" - regex = '''(?i)stripe(.{0,20})?[sr]k_live_[0-9a-zA-Z]{24}''' - tags = ["key", "Stripe"] - -[[rules]] - description = "Square access token" - regex = '''sq0atp-[0-9A-Za-z\-_]{22}''' - tags = ["key", "square"] - -[[rules]] - description = "Square OAuth secret" - regex = '''sq0csp-[0-9A-Za-z\\-_]{43}''' - tags = ["key", "square"] - -[[rules]] - description = "Twilio API key" - regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}''' - tags = ["key", "twilio"] - -[[rules]] - description = "Dynatrace ttoken" - regex = '''dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}''' - tags = ["key", "Dynatrace"] - -[[rules]] - description = "Shopify shared secret" - regex = '''shpss_[a-fA-F0-9]{32}''' - tags = ["key", "Shopify"] - -[[rules]] - description = "Shopify access token" - regex = '''shpat_[a-fA-F0-9]{32}''' - tags = ["key", "Shopify"] - -[[rules]] - description = "Shopify custom app access token" - regex = '''shpca_[a-fA-F0-9]{32}''' - tags = ["key", "Shopify"] - -[[rules]] - description = "Shopify private app access token" - regex = '''shppa_[a-fA-F0-9]{32}''' - tags = ["key", "Shopify"] - -[[rules]] - description = "PyPI upload token" - regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}''' - tags = ["key", "pypi"] - -[allowlist] - description = "Allowlisted files" - paths = [ - '''^\.?gitleaks.toml$''', - '''topo/node/srl/generate_certificate_success$''', # exclude dummy test file with random cert - '''(.*?)super-linter.log$''', # exclude linter logs which might contain past errored runs with keys/certs - '''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''', - '''(go.mod|go.sum)$''' - ] \ No newline at end of file diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml deleted file mode 100644 index dca2af2..0000000 --- a/.github/linters/.golangci.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -######################### -######################### -## Golang Linter rules ## -######################### -######################### - -# configure golangci-lint -# see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml -run: - timeout: 10m -issues: - exclude-rules: - - path: _test\.go - linters: - - dupl - - gosec - - goconst - new: true -linters: - enable: - - gosec - - unconvert - - goconst - - goimports - - gofmt - - gocritic - - govet - - revive - - staticcheck - - unconvert - - unparam - - unused - - wastedassign - - whitespace -linters-settings: - errcheck: - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; - # default is false: such cases aren't reported by default. - check-blank: true - govet: - # report about shadowed variables - check-shadowing: false - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - gocritic: - disabled-checks: - - singleCaseSwitch - - appendAssign - revive: - ignore-generated-header: true - severity: warning diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml deleted file mode 100644 index e9ec8be..0000000 --- a/.github/linters/.yaml-lint.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -########################################### -# These are the rules used for # -# linting all the yaml files in the stack # -# NOTE: # -# You can disable line with: # -# # yamllint disable-line # -########################################### -rules: - braces: - level: warning - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: 1 - max-spaces-inside-empty: 5 - brackets: - level: warning - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: 1 - max-spaces-inside-empty: 5 - colons: - level: warning - max-spaces-before: 0 - max-spaces-after: 1 - commas: - level: warning - max-spaces-before: 0 - min-spaces-after: 1 - max-spaces-after: 1 - comments: disable - comments-indentation: disable - document-end: disable - document-start: - level: warning - present: true - empty-lines: - level: warning - max: 2 - max-start: 0 - max-end: 0 - hyphens: - level: warning - max-spaces-after: 1 - indentation: - level: warning - spaces: consistent - indent-sequences: true - check-multi-line-strings: false - key-duplicates: enable - line-length: - level: warning - max: 120 - allow-non-breakable-words: true - allow-non-breakable-inline-mappings: true - new-line-at-end-of-file: disable - new-lines: - type: unix - trailing-spaces: disable diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a112af0..878730d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,15 +7,12 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/go.yml@a0a686b0792f164c0cf587825fd742223abe9dc1 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@a541e6321f4ed70740579fec91da6a96732e365d with: static-analysis-excludes-regex: exampleoc skip-gofmt: true skip-staticcheck: true - linter: - uses: openconfig/common-ci/.github/workflows/linter.yml@a0a686b0792f164c0cf587825fd742223abe9dc1 - generate: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..3674e08 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: golangci-lint +on: + push: + branches: + - main + pull_request: +permissions: + contents: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: '1.x' + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + only-new-issues: true From 689a0f0058a0cf498a88b3cdfd0c14e731372259 Mon Sep 17 00:00:00 2001 From: wenovus Date: Thu, 10 Aug 2023 08:45:06 -0700 Subject: [PATCH 30/31] use latest --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 878730d..d6b7cad 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@a541e6321f4ed70740579fec91da6a96732e365d + uses: openconfig/common-ci/.github/workflows/basic_go.yml@787b41151fa155a32aa28f40486fa394eac5c8c6 with: static-analysis-excludes-regex: exampleoc skip-gofmt: true @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '1.x' + go-version: 'stable' - name: Generate and Check Diff # Ignore whitespace because goimports seems to modifying the generated commands inconsistently. From f430a4c1e6789f94e2433fe9e0e691e2b525f5fd Mon Sep 17 00:00:00 2001 From: wenovus Date: Mon, 14 Aug 2023 17:25:21 -0700 Subject: [PATCH 31/31] use latest --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d6b7cad..48d9959 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@787b41151fa155a32aa28f40486fa394eac5c8c6 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@c2294c3c86c90e75e58c24a40d6f7f3364bbae9d with: static-analysis-excludes-regex: exampleoc skip-gofmt: true