This bot is deprecated and is planned for shutdown August 4, 2025.
We suggest looking into a supported GitHub actions implementation. You can find a few options: https://github.com/marketplace?query=license+header&type=actions
A GitHub App built with Probot that ensures source files contain a valid license header.
You can install this bot from GitHub.
To configure the bot, you can create a configuration file:
.github/header-checker-lint.yml. The contents of this yaml file
define a JSON object with the following options:
| Name | Description | Type | Default |
|---|---|---|---|
allowedCopyrightHolders |
List of allowed copyright holders | string[] |
[] |
allowedLicenses |
The allowed licenses. | string[] |
["Apache-2.0", "MIT", "BSD-3"] |
ignoreFiles |
List of files to ignore. These values will be treated as path globs | string[] |
[] |
ignoreLicenseYear |
Ignore license header year check | boolean |
false |
sourceFileExtensions |
List of file extensions that will be treated as source files | string[] |
["ts", "js", "java"] |
Here is the default configuration:
allowedCopyrightHolders:
- 'Google LLC'
allowedLicenses:
- 'Apache-2.0'
- 'MIT'
- 'BSD-3'
sourceFileExtensions:
- 'ts'
- 'js'
- 'java'
# ignoreFiles are emptyThe config is not additive, so if you want to add ignoreFiles, you should copy other fields into your config file.
Normally our bot reads configuration file from the default branch, but this bot is exceptionally reading the config file from the PR head.
If you want to trigger the bot on a particular PR, add the label header-checker-lint:force-run to the PR.
# Install dependencies
npm install
# Run the bot
npm startThis bot uses nock for mocking requests to GitHub, and snap-shot-it for capturing responses; This allows updates to the API surface to be treated as a visual diff, rather than tediously asserting against each field.
Running tests:
npm run testTo update snapshots:
npm run test:snapIf you have suggestions for how header-checker-lint could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
Apache 2.0 © 2019 Google Inc.