Skip to content

Commit

Permalink
small fixes to script
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Jan 16, 2025
1 parent d0e3078 commit 3fe73cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/scripts/external-packages-license-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
)

var licenseRegexp *regexp.Regexp = regexp.MustCompile("// SPDX-License-Identifier: ([^\\s]*)")
var licenseRegexp = regexp.MustCompile("// SPDX-License-Identifier: ([^\\s]*)$")

func fileLicense(path string) (string, error) {
file, err := os.Open(path)
Expand Down Expand Up @@ -52,12 +52,13 @@ func checkDirLicense(path string, valid string) error {
}

func run() error {
exportedPkgsDir := "pkg"
err := checkDirLicense(exportedPkgsDir, "Apache-2.0")
// Check external packages licenses.
err := checkDirLicense("pkg", "Apache-2.0")
if err != nil {
return fmt.Errorf("invalid license in exported package: %s", err)
}

// Check the internal dependencies of the external packages.
output, err := exec.Command("sh", "-c", "go list -deps -test ./pkg/*").Output()
if err != nil {
return err
Expand Down

0 comments on commit 3fe73cb

Please sign in to comment.