File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Update copyright license'
2
+ description : Update license years automatically
3
+ author : " TheAlgorithms"
4
+ inputs :
5
+ filename :
6
+ description : License file name
7
+ required : true
8
+ default : LICENSE
9
+ initial_year :
10
+ description : Year of the repository's creation
11
+ required : true
12
+ default : 2016
13
+ runs :
14
+ using : composite
15
+ steps :
16
+ - name : Update the License
17
+ run : |
18
+ (echo "Copyright (C) ${{ inputs.initial_year }}-$(date +"%Y") TheAlgorithms and contributors"; tail -n +2 ${{ inputs.filename }}) > License.tmp
19
+ mv License.tmp ${{ inputs.filename }}
20
+ - name : Setup Git configurations
21
+ shell : bash
22
+ run : |
23
+ git config --global user.name github-actions[bot]
24
+ git config --global user.email 'github-actions@users.noreply.github.com'
25
+ - name : Commit to a new branch and push changes
26
+ shell : bash
27
+ run : |
28
+ git checkout -b license-update-${{ github.sha }}
29
+ git commit -m "docs: updating copyright license year"
30
+ git push
31
+ - name : Creating and merging the PR
32
+ shell : bash
33
+ run : |
34
+ if [[ `git status --porcelain` ]]; then
35
+ gh pr create --base master --head license-update-${{ github.sha }} --title 'docs: updating `License` copyright' --body 'Updated License copyright (see the diff. for changes).'
36
+ env :
37
+ GH_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments