Add License Header
Determine the target files from the request:
- For a file path, target that file.
- For a directory, target every file beneath it whose extension matches the project's source extensions.
Read the first 20 lines of every target file and look for
SPDX-License-Identifier.If that string is present, skip the file. Never add a second SPDX license header.
Otherwise, insert these exact lines at the very top of the file, before all existing content:
// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2026 Acme CorpAlways put the header at the absolute beginning; never place it after a shebang, comment, or any other existing content.
Report the files changed and the files skipped because they already had a header.