-
Notifications
You must be signed in to change notification settings - Fork 168
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
7449: Add GitHub action to verify copyright year #530
Conversation
👋 Welcome back aptmac! A progress list of the required criteria for merging this PR into |
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.
An improvement could be to check for having the mandatory copyright header for new files.
@aptmac This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
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.
This is a good addition for formal correctness.
/integrate |
Going to push as commit 51e952e.
Your commit was automatically rebased without conflicts. |
This PR looks to address JMC-7449 [0], in which it'd be nice to have a GitHub action that checks the copyright year of changed files (useful for PR reviews).
I've added a
check_copyright_year
job to the github workflow, that checks out the repository and then runs a bash script. This bash script lives alongside theupdatecopyrightyear.sh
script and other build-related scripts in/scripts
. By usingfetch-depth: 0
on the workflow job, we're able to do a git diff against origin/master to get a list of all files that have been altered in a given PR. From there it does a similar file extension check to whatupdatecopyrightyear.sh
does, and then uses sed to get the "latest" copyright years (there can be multiple if the header has multiple company names). It compares those years to the current year, and if there is not a match then it prints out the filename to the console and increases a counter that gets printed out when the script returns 1.I made a quick test commit (link) that changed a handful of files without updating their headers, the GH workflow can be found here: https://github.com/aptmac/jmc/actions/runs/6712104409/job/18240941002
Example of what the workflow looks like:
[0] https://bugs.openjdk.org/browse/JMC-7449
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmc.git pull/530/head:pull/530
$ git checkout pull/530
Update a local copy of the PR:
$ git checkout pull/530
$ git pull https://git.openjdk.org/jmc.git pull/530/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 530
View PR using the GUI difftool:
$ git pr show -t 530
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jmc/pull/530.diff
Webrev
Link to Webrev Comment