diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index e748af08c..6200df50d 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -108,8 +108,14 @@ jobs: for ios_header in *.h; do # Each file in this directory matches a file in the Analytics iOS SDK. cp -vf "${podtmp}/${header_dir}/${ios_header}" . + # If the file doesn't have a Google copyright, add one. + if ! grep -q "^// Copyright [0-9]* Google LLC" "${ios_header}"; then + copyright_line="// Copyright $(date +%Y) Google LLC\n" + else + copyright_line= + fi # Add a note to each file about its source. - sed -i~ 's|^/// @file|\n// Copied from Firebase Analytics iOS SDK '"${analytics_version}"'.\n\n/// @file|' "${ios_header}" + sed -i~ "s|^/// @file|${copyright_line}\n// Copied from Firebase Analytics iOS SDK ${analytics_version}.\n\n/// @file|" "${ios_header}" rm -f "${ios_header}~" # remove backup file that sed generated python ../../scripts/format_code.py --f "${ios_header}" done