Skip to content
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 license checker GH action #3721

Merged
merged 5 commits into from
Apr 2, 2024
Merged

add license checker GH action #3721

merged 5 commits into from
Apr 2, 2024

Conversation

gdams
Copy link
Member

@gdams gdams commented Mar 20, 2024

I've written a handy shell script to set the copyright dates correctly based on git commit history:

#!/bin/bash

# Directory containing the files to be checked
DIRECTORY="$PWD"

# Loop through all files in the specified directory
find "$DIRECTORY" -type f | while read -r file; do
    # Check if the specific line exists in the file
    if grep -q "Copyright (c) 2024 Contributors to the Eclipse Foundation" "$file"; then
        echo "Found in file: $file"
        
        # Find the original commit date of the file
        original_date=$(git log --format=%aD "$file" | tail -1)
        
        # Extract the year from the original commit date
        original_year=$(date -d "$original_date" "+%Y" 2>/dev/null) || original_year=$(date -jf "%a %b %d %T %Y %z" "$original_date" "+%Y")
        
        # Replace "2024" with the original year in the file
        sed -i "" "s/2024/$original_year/g" "$file"
        
        echo "Updated to: Copyright (c) $original_year Contributors to the Eclipse Foundation"
    fi
done

@github-actions github-actions bot added docker Issues related to our docker files and docker scripts macos Issues that affect or relate to the MAC OS jenkins Issues that enhance or fix our jenkins server documentation Issues that request updates to our documentation windows Issues that affect or relate to the WINDOWS OS installer Issues that relate to our installer jobs or installer repo solaris Issues that affect or relate to the SOLARIS OS aix Issues that affect or relate to the AIX OS ghActions alpine-linux Issues that affect or relate to the Alpine LINUX OS security labels Mar 20, 2024
Copy link

Thank you for creating a pull request!
If you have not done so already, please familiarise yourself with our Contributing Guidelines and FAQ, even if you have contributed to the Adoptium project before. GitHub actions will now run a set of jobs against your PR that will lint and unit test your changes. Keep an eye out for the results from these on the latest commit you submitted. For more information, please see our testing documentation.

@gdams gdams force-pushed the license branch 3 times, most recently from 5c37ddf to 9ee142d Compare March 20, 2024 16:59
Copy link
Contributor

@tellison tellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright notice is incorrect.

@tellison
Copy link
Contributor

  1. Is it possible split out the license eye action (license-eye) and configuration (licenserc) into a shareable location (propose adoptium/.github/workflows)?

  2. The copyright of contributions does not belong to the Eclipse Foundation, so the headers in this PR are incorrect. If we don't know the specific contributors it should be a generic statement as advised in the developer handbook, with an update to the notice file.

Copyright (c) {year} Contributors to the Eclipse Foundation

  1. Might as well add an SPDX and other configuration options too since it is automated. I propose we don't use the contributors optional section of headers.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A block has been put on this Pull Request as this repository is temporarily under a code freeze due to an ongoing release cycle.

If this pull request needs to be merged during the release cycle then please comment /merge and a PMC member will be able to remove the block.

If the code freeze is over you can remove this block by commenting /thaw.

@tellison tellison removed docker Issues related to our docker files and docker scripts macos Issues that affect or relate to the MAC OS jenkins Issues that enhance or fix our jenkins server windows Issues that affect or relate to the WINDOWS OS installer Issues that relate to our installer jobs or installer repo solaris Issues that affect or relate to the SOLARIS OS aix Issues that affect or relate to the AIX OS alpine-linux Issues that affect or relate to the Alpine LINUX OS security labels Mar 20, 2024
@github-actions github-actions bot added docker Issues related to our docker files and docker scripts macos Issues that affect or relate to the MAC OS labels Mar 20, 2024
@gdams gdams removed the security label Apr 2, 2024
Copy link
Contributor

@tellison tellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of items to fix, remove the copyright claim from third-party public keys, and update the tool ignore list for them.
Good to see the dates on the copyright being fixed up!

.github/linters/.markdown-lint.yml Outdated Show resolved Hide resolved
.github/linters/sun_checks.xml Outdated Show resolved Hide resolved
sbin/sig_check/freemarker.asc Outdated Show resolved Hide resolved
sbin/sig_check/freetype.asc Outdated Show resolved Hide resolved
.licenserc.yaml Show resolved Hide resolved
@github-actions github-actions bot added docker Issues related to our docker files and docker scripts macos Issues that affect or relate to the MAC OS jenkins Issues that enhance or fix our jenkins server windows Issues that affect or relate to the WINDOWS OS installer Issues that relate to our installer jobs or installer repo solaris Issues that affect or relate to the SOLARIS OS aix Issues that affect or relate to the AIX OS ghActions alpine-linux Issues that affect or relate to the Alpine LINUX OS security labels Apr 2, 2024
@gdams gdams removed docker Issues related to our docker files and docker scripts macos Issues that affect or relate to the MAC OS jenkins Issues that enhance or fix our jenkins server windows Issues that affect or relate to the WINDOWS OS installer Issues that relate to our installer jobs or installer repo solaris Issues that affect or relate to the SOLARIS OS aix Issues that affect or relate to the AIX OS ghActions alpine-linux Issues that affect or relate to the Alpine LINUX OS security labels Apr 2, 2024
@gdams
Copy link
Member Author

gdams commented Apr 2, 2024

Just a couple of items to fix, remove the copyright claim from third-party public keys, and update the tool ignore list for them. Good to see the dates on the copyright being fixed up!

@tellison updated PTAL

@gdams gdams requested a review from tellison April 2, 2024 14:18
@gdams gdams merged commit 646a79f into adoptium:master Apr 2, 2024
7 of 25 checks passed
@gdams gdams deleted the license branch April 2, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues that request updates to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants