Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
fix(ci): log failed files
Browse files Browse the repository at this point in the history
When the CI fails during check for license header, log the failed file to console so that someone can check on the actual file. Also simplify the grep check to make it more human readable and understandable

Signed-off-by: Rodney Osodo <[email protected]>
  • Loading branch information
rodneyosodo committed Nov 17, 2023
1 parent 82c675f commit 8103f82
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 19 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/check-license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ jobs:

- name: Check License Header
run: |
if [ "$(grep -rcL --exclude-dir=.git --exclude-dir=build \
--exclude=\*.crt --exclude=\*.key --exclude=\*.pem \
--exclude=\*.zed --exclude=\*.hcl \
--exclude=CODEOWNERS --exclude=LICENSE --exclude=MAINTAINERS \
--exclude=\*.md --exclude=\*.json --exclude=\*.csv \
--exclude=\*.mod --exclude=\*.sum \
--exclude=\*.tmpl --exclude=\*.args \
--regexp "Copyright (c) Abstract Machines" .)" ]; then
echo "License header check failed"
CHECK=$(grep -rcL --exclude-dir={.git,build} \
--exclude=\*.{crt,key,pem,zed,hcl,md,json,csv,mod,sum,tmpl,args} \
--exclude={CODEOWNERS,LICENSE,MAINTAINERS} \
--regexp "Copyright (c) Abstract Machines" .)
if [ "$CHECK" ]; then
echo "License header check failed. Fix the following files:"
echo "$CHECK"
exit 1
fi
2 changes: 1 addition & 1 deletion auth/api/http/domains/decode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package domains
Expand Down
2 changes: 1 addition & 1 deletion auth/api/http/domains/endpoint.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package domains
Expand Down
2 changes: 1 addition & 1 deletion auth/api/http/domains/requests.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package domains
Expand Down
2 changes: 1 addition & 1 deletion auth/api/http/domains/responses.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package domains
Expand Down
2 changes: 1 addition & 1 deletion auth/api/http/domains/transport.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package domains
Expand Down
2 changes: 1 addition & 1 deletion auth/domains.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package auth
Expand Down
2 changes: 1 addition & 1 deletion auth/mocks/domains.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package mocks
Expand Down
2 changes: 1 addition & 1 deletion auth/postgres/domains.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package postgres
Expand Down
3 changes: 3 additions & 0 deletions auth/postgres/domains_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package postgres_test

import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

package auth
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Magistrala
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

// Package auth contains the domain concept definitions needed to support
Expand Down

0 comments on commit 8103f82

Please sign in to comment.