Skip to content

Conversation

@ParagEkbote
Copy link
Contributor

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

Who can review?

@sayakpaul

@ParagEkbote ParagEkbote changed the title Create gh action and Script to update Copyright Year for files. [CI] Create gh action and Script to update Copyright Year for Source Files Oct 22, 2025
Copy link
Member

@sayakpaul sayakpaul left a 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?

Comment on lines +32 to +35
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\.)"),
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ParagEkbote
Copy link
Contributor Author

I have tested the workflow in my fork and it's working correctly; you can view it here: ParagEkbote#1

Could you please review?

@ParagEkbote ParagEkbote requested a review from sayakpaul October 23, 2025 07:24
@sayakpaul
Copy link
Member

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.

@ParagEkbote
Copy link
Contributor Author

ParagEkbote commented Oct 23, 2025

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?

@JoeGaffney
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants