Skip to content

Commit 1d89003

Browse files
committed
Update license_check.yml
Check README.md for copyright only and skip README at root level.
1 parent a6c5afb commit 1d89003

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

.github/workflows/license_check.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
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

0 commit comments

Comments
 (0)