-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GH Action to check SPDX license headers in new files. #4166
Add GH Action to check SPDX license headers in new files. #4166
Conversation
c638549
to
b46fa32
Compare
0f7974e
to
7defec1
Compare
7defec1
to
a283af4
Compare
a283af4
to
3467ec6
Compare
3467ec6
to
4e1c7e9
Compare
tools/spdx-check.sh
Outdated
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# List of files to check, excluding vendor directories | ||
files=$(git diff --name-only --diff-filter=A origin/master..HEAD | grep -v "vendor/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if origin/master..HEAD
is going to work for backports (once this script becomes part of some LTS branch).
Maybe we could pass ${{ github.event.pull_request.base.ref }}
as an input argument to this script (or github.base_ref
, I don't know which one is the correct in this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good suggestion! I'll change to base.ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like he fixed version works
4e1c7e9
to
2035698
Compare
2035698
to
c9614d8
Compare
I want to add .proto files to the list... |
c9614d8
to
508937e
Compare
5a231a6
to
9d78904
Compare
@rene, could you recheck please? |
Created a workflow to automatically check for SPDX license headers in new files when a PR is opened or changes are pushed to `master` or version-stable branches. Added `tools/spdx-check.sh` script that scans new files with specific extensions and certain filenames for the `SPDX-License-Identifier` header. The script excludes files in `vendor/` directories from the check. The workflow will fail if any of the new files are missing the required SPDX license header. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
9d78904
to
e68eca1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OhmSpectator for now it's ok, we do care about Apache 2.0, but please, consider add Apache 2.0 compatible licenses in the future....
@rene, do you find this list fine for it? MIT License: |
master
or version-stable branches.tools/spdx-check.sh
script that scans new files with specific extensions and certain filenames for theSPDX-License-Identifier
header.vendor/
directories from the check.