-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: make sure all checked in files have SeatGeek copyright (#26)
* add add-copyrights.sh script * add check copyright header job to build workflow * add nicer title here * remove copyright in file to test workflow * fix filename * only show name of files that need to be updated * tell user to run script if fails * run add copyrights script
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Define the copyright header | ||
read -r -d '' COPYRIGHT_HEADER << EOM | ||
/* | ||
* Copyright SeatGeek | ||
* Licensed under the terms of the Apache-2.0 license. See LICENSE file in project root for terms. | ||
*/ | ||
EOM | ||
|
||
# Loop over .ts and .tsx files in the plugins/ directory | ||
for file in $(find plugins -type f \( -name "*.ts" -o -name "*.tsx" \)); do | ||
# Check if the file is ignored by Git | ||
if ! git check-ignore $file > /dev/null 2>&1; then | ||
# If it's not ignored, check if the copyright header already exists in the file | ||
if ! [[ "$(head -n4 $file)" == *"$COPYRIGHT_HEADER"* ]]; then | ||
echo $file Δ | ||
echo "${COPYRIGHT_HEADER} | ||
$(cat $file)" > $file | ||
fi | ||
fi | ||
done |