8000 fix: copyright license script (#28) · cgb-algorithm/scripts@619ac06 · GitHub
[go: up one dir, main page]

Skip to content

Commit 619ac06

Browse files
fix: copyright license script (TheAlgorithms#28)
* fix: copyright license script * fix: use proper GitHub branch * chore: apply suggestions from code review Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> --------- Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
1 parent cbc710e commit 619ac06

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

license_copyright/license.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: 'Update copyright license'
2-
description: Update license years automatically
2+
description: Updates copyright license year automatically
33
author: "TheAlgorithms"
44
inputs:
55
filename:
6-
description: License file name
6+
description: "License filename"
77
required: true
88
default: LICENSE
99
initial_year:
10-
description: Year of the repository's creation
10+
description: "Year of the repository's creation"
1111
required: true
1212
default: 2016
1313
runs:
@@ -27,11 +27,12 @@ runs:
2727
run: |
2828
git checkout -b license-update-${{ github.sha }}
2929
git commit -m "docs: updating copyright license year"
30-
git push
30+
git push origin license-update-${{ github.sha }}:license-update-${{ github.sha }}
3131
- name: Creating and merging the PR
3232
shell: bash
3333
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).'
34+
if [[ $(git log --branches --not --remotes) ]]; then
35+
gh pr create --base ${GITHUB_REF##*/} --head license-update-${{ github.sha }} --title 'docs: updating `License` copyright' --body 'Updated License copyright (see the diff. for changes).'
36+
fi
3637
env:
3738
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)
0