-
Notifications
You must be signed in to change notification settings - Fork 6.4k
[CI] Create gh action and Script to update Copyright Year for Source Files #12528
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
base: main
Are you sure you want to change the base?
[CI] Create gh action and Script to update Copyright Year for Source Files #12528
Conversation
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.
Thanks for starting it. Would it be possible to create a draft PR with this workflow and see if it's working as expected?
| re.compile(r"(# Copyright )(\d{4})( The HuggingFace Team\.)"), | ||
| re.compile(r"(# Copyright \(c\) )(\d{4})( The HuggingFace Team\.)"), | ||
| re.compile(r"(Copyright )(\d{4})( The HuggingFace Team\.)"), | ||
| re.compile(r"(Copyright \(c\) )(\d{4})( The HuggingFace Team\.)"), |
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.
Sometimes the Copyright starts with a different team name:
| # Copyright 2025 Black Forest Labs, The HuggingFace Team and The InstantX Team. All rights reserved. |
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 have covered this pattern as well. You can view it in this PR: https://github.com/ParagEkbote/diffusers/pull/1/files#diff-15d8601315be2c5bfcd65bf7c17764dda7c0a66190e5113974939d127390340d
|
I have tested the workflow in my fork and it's working correctly; you can view it here: ParagEkbote#1 Could you please review? |
|
I left some questions on that PR. I think changing the copyright year is quite simple to perform in an editor like VSCode and for that maintaining a workflow is likely an overkill. |
It's meant to be a utility script that can be run to save time and since there are dates which are not updated from 2020, it can be useful. WDYT? |
|
While automating copyright updates is convenient, updating all files every year will create a lot of Git history noise. Copyright is primarily relevant to when a file was created or significantly modified, so it might be cleaner to either keep the original year or use a range of years reflecting actual modifications. This would reduce unnecessary commits and keep Git history more meaningful. |
What does this PR do?
Since ever year, updating the copyright dates for files has been manual, this PR introduces a gh-action and script which can be triggered once a year to update the date for all files. The gh-action will open a PR to update the dates instead of committing changes directly on main. Could you please review?
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@sayakpaul