Skip to content

Commit a3743d6

Browse files
authored
License check update (#11)
* include README.md in scan for license/copywrite * rename README.md to readme.md * Update license_check.yml Check README.md for copyright only and skip README at root level.
1 parent e8b121c commit a3743d6

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

.github/workflows/license_check.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ jobs:
1616
failed=0
1717
# Find files: .sh, .go, .swift, .py
1818
# Exclude hidden directories/files (like inside .git)
19-
files=$(find . -type f \( -name "*.sh" -o -name "*.go" -o -name "*.swift" -o -name "*.py" \) -not -path '*/.*')
19+
files=$(find . -type f \( -name "*.sh" -o -name "*.go" -o -name "*.swift" -o -name "*.py" -o -name "README.md" \) -not -path '*/.*')
2020
2121
for file in $files; do
22+
if [ "$file" = "./README.md" ]; then
23+
continue
24+
fi
25+
2226
missing_reqs=0
2327
2428
# Requirement 1: A line with both "Copyright" and "Jamf"
@@ -28,16 +32,21 @@ jobs:
2832
missing_reqs=1
2933
fi
3034
31-
# Requirement 2: Specific license string
32-
if ! grep -Fq "This work is licensed under the terms of the Jamf Source Available License" "$file"; then
33-
echo "::error file=$file::Missing 'This work is licensed under the terms of the Jamf Source Available License'"
34-
missing_reqs=1
35-
fi
36-
37-
# Requirement 3: License URL
38-
if ! grep -Fq "https://github.com/jamf/scripts/blob/main/LICENCE.md" "$file"; then
39-
echo "::error file=$file::Missing 'https://github.com/jamf/scripts/blob/main/LICENCE.md'"
40-
missing_reqs=1
35+
filename=$(basename "${file}")
36+
if [ "${filename}" = "README.md" ]; then
37+
echo "skipping license check for: ${file}"
38+
else
39+
# Requirement 2: Specific license string
40+
if ! grep -Fq "This work is licensed under the terms of the Jamf Source Available License" "$file"; then
41+
echo "::error file=$file::Missing 'This work is licensed under the terms of the Jamf Source Available License'"
42+
missing_reqs=1
43+
fi
44+
45+
# Requirement 3: License URL
46+
if ! grep -Fq "https://github.com/jamf/scripts/blob/main/LICENCE.md" "$file"; then
47+
echo "::error file=$file::Missing 'https://github.com/jamf/scripts/blob/main/LICENCE.md'"
48+
missing_reqs=1
49+
fi
4150
fi
4251
4352
if [ $missing_reqs -eq 1 ]; then
File renamed without changes.

0 commit comments

Comments
 (0)