Skip to content

Conversation

@alexpantyukhin
Copy link
Member

add Update copyright license

@Panquesito7 Panquesito7 added the enhancement New feature or request label Apr 7, 2023
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

We could potentially make it a usable and configurable action (like this one).
What do you think about that? 🤔

Overall, it's looking great, though. Thanks. 🙂

@alexpantyukhin
Copy link
Member Author

alexpantyukhin commented Apr 10, 2023

@Panquesito7 This is a good idea! But what actually could be configurable there?

@Panquesito7
Copy link
Member

Panquesito7 commented Apr 14, 2023

@Panquesito7 This is a good idea! But what actually could be configurable there?

Hmm, that's right. I guess it's a good idea to stick to this. 👍
To use this in other repositories, the whole file will need to be copied (we might want to explain this in a readme file or something).

Panquesito7
Panquesito7 previously approved these changes Apr 14, 2023
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Thanks! 🚀

@Panquesito7 Panquesito7 requested a review from tjgurwara99 April 14, 2023 16:13
@Panquesito7 Panquesito7 linked an issue Apr 14, 2023 that may be closed by this pull request
Comment on lines 10 to 12
run: |
(echo "Copyright (C) 2016-$(date +"%Y") TheAlgorithms and contributors"; tail -n +2 License) > License.tmp
mv License.tmp License
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
run: |
(echo "Copyright (C) 2016-$(date +"%Y") TheAlgorithms and contributors"; tail -n +2 License) > License.tmp
mv License.tmp License
run: |
(echo "Copyright (C) 2016-$(date +"%Y") TheAlgorithms and contributors"; tail -n +2 LICENSE) > License.tmp
mv License.tmp LICENSE

However, since you're making this more general as an action - I would recommend to make this a variable instead of License or LICENSE since the license file can be named in myriad of ways.

Copy link
Member

Choose a reason for hiding this comment

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

Some repositories also use LICENSE.txt or LICENSE.md (that's what I use).

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
Panquesito7
Panquesito7 previously approved these changes Apr 14, 2023
Copy link
Member

@tjgurwara99 tjgurwara99 left a comment

Choose a reason for hiding this comment

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

I've added a patch (suggested change) in a comment to what I mean by the following. What you had created was a per repository workflow which couldn't be used in a different repository for various reasons. The patch shows you how you can make it so that other workflow files can call this exact workflow similar to the way you were calling uses: stefanzweifel/git-auto-commit-action@v4. I've removed the use of stefanzweifel/git-auto-commit-action@v4 because I don't think we need that kind of hammer for a problem that you can use your thumb for 😄 plus I prefer less dependencies so there is less chance for them to go wrong.

@tjgurwara99
Copy link
Member

tjgurwara99 commented Apr 14, 2023

There are a few other changes that I would like you to make but to explain them over PR would be difficult. I've made those changes in the attached patch file. Just download and do apply the patch to your fork git apply workflow.patch where workflow.patch is the file you downloaded.

workflow.patch

Let me know if you didn't understand something inside this patch 😄

Once you apply the patch, you should have 3 changed files, commit them to your fork, push your changes and run the workflow by going to your Actions tab and the update-license with the dispatch trigger. That way you can see it works the way you expect your workflow to work.

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
@Panquesito7 Panquesito7 changed the title Update copyright license Update copyright license script Jun 11, 2023
alexpantyukhin and others added 2 commits June 12, 2023 10:22
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Panquesito7 and others added 3 commits June 12, 2023 11:17
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
tjgurwara99
tjgurwara99 previously approved these changes Jun 13, 2023
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Amazing! Thank you. 🚀

@Panquesito7 Panquesito7 merged commit d10fd51 into TheAlgorithms:main Jun 13, 2023
@Panquesito7
Copy link
Member

Would you like to add these in the C/C++ repositories, or should we create an issue to have it open to someone else? @alexpantyukhin.

@alexpantyukhin
Copy link
Member Author

@Panquesito7 I think I can do it. What is the best way to do this? Just copy this script into the .github folder?

@Panquesito7
Copy link
Member

I think we need to it similar to this:

      - name: Filename Formatter
        uses: TheAlgorithms/scripts/formatter@main
        with:
          filetypes: .c,.h

However, let's wait a bit. I think there's something wrong with the script, not 100% sure, though.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a script to update the year to the current year

3 participants