-
-
Notifications
You must be signed in to change notification settings - Fork 46
Update copyright license script #22
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
Merged
Panquesito7
merged 9 commits into
TheAlgorithms:main
from
alexpantyukhin:add_license_copyright_script
Jun 13, 2023
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b6d9bb3
Update copyright license
alexpantyukhin c152ab3
Update license_copyright/license.yml
alexpantyukhin 2236a8f
Update license_copyright/license.yml
alexpantyukhin 6df0655
Update license_copyright/license.yml
alexpantyukhin eb8efba
Update license_copyright/license.yml
alexpantyukhin 07d3b1c
chore: apply suggestions from code review
Panquesito7 61daee1
Update license_copyright/license.yml
alexpantyukhin 469c5e9
Update license_copyright/license.yml
alexpantyukhin d2a4ff8
chore: apply suggestions from code review
Panquesito7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: 'Update copyright license' | ||
| description: Update license years automatically | ||
| author: "TheAlgorithms" | ||
| inputs: | ||
| filename: | ||
| description: License file name | ||
| required: true | ||
| default: LICENSE | ||
| initial_year: | ||
| description: Year of the repository's creation | ||
| required: true | ||
| default: 2016 | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Update the License | ||
| run: | | ||
| (echo "Copyright (C) ${{ inputs.initial_year }}-$(date +"%Y") TheAlgorithms and contributors"; tail -n +2 ${{ inputs.filename }}) > License.tmp | ||
| mv License.tmp ${{ inputs.filename }} | ||
| - name: Setup Git configurations | ||
| shell: bash | ||
| run: | | ||
| git config --global user.name github-actions[bot] | ||
| git config --global user.email 'github-actions@users.noreply.github.com' | ||
| - name: Commit to a new branch and push changes | ||
| shell: bash | ||
| run: | | ||
| git checkout -b license-update-${{ github.sha }} | ||
| git commit -m "docs: updating copyright license year" | ||
| git push | ||
| - name: Creating and merging the PR | ||
| shell: bash | ||
| run: | | ||
| if [[ `git status --porcelain` ]]; then | ||
| gh pr create --base master --head license-update-${{ github.sha }} --title 'docs: updating `License` copyright' --body 'Updated License copyright (see the diff. for changes).' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.