Skip to content

frgfm/validate-python-headers

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Header validator for your Python files

CI Status ruff ruff

GitHub release (latest by date) GitHub

This action checks the copyright and license notices in the headers of your Python files.

Inputs

owner

Required The copyright owner.

starting-year

Required The starting year of your project.

license

Identifier of the license for your project (cf. SPDX identifiers). Default null.

folders

The folders to inspect, separated by a comma. Default ".".

ignore-files

The files to ignore, separated by a comma. Default "__init__.py".

ignore-folders

The folders to ignore, separated by a comma. Default ".github/".

license-notice

The path to a license notice text. If license is null, the header will be expected to have this text as a license notice. Default null.

Outputs

The list of files with header issues and the suggested format (cf. example below):

Your header should look like:

# Copyright (C) <FILE_CREATION_YEAR>, Pyronear.

# This program is licensed under the Apache License 2.0.

Example usages

Using an Open-source license:

uses: frgfm/validate-python-headers@main
with:
  license: 'Apache-2.0'
  owner: 'François-Guillaume Fernandez'
  starting-year: 2022
  ignore-files: 'version.py,__init__.py'
  ignore-folders: '.github/'

On closed source code:

uses: frgfm/validate-python-headers@main
with:
  license-notice: '.github/license-notice.txt'
  owner: 'François-Guillaume Fernandez'
  starting-year: 2022
  ignore-files: 'version.py,__init__.py'
  ignore-folders: '.github/'

Contributing

Any sort of contribution is greatly appreciated!

You can find a short guide in CONTRIBUTING to help grow this project!

License

Distributed under the Apache 2.0 License. See LICENSE for more information.