From 57a927865e75211c150a01e4c9d56bc05491778b Mon Sep 17 00:00:00 2001 From: David Leal Date: Tue, 27 Jun 2023 14:17:51 -0600 Subject: [PATCH 1/3] fix: copyright license script --- license_copyright/license.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/license_copyright/license.yml b/license_copyright/license.yml index 9777188..39edca0 100644 --- a/license_copyright/license.yml +++ b/license_copyright/license.yml @@ -1,13 +1,13 @@ name: 'Update copyright license' -description: Update license years automatically +description: Updates copyright license year automatically author: "TheAlgorithms" inputs: filename: - description: License file name + description: "License filename" required: true default: LICENSE initial_year: - description: Year of the repository's creation + description: "Year of the repository's creation" required: true default: 2016 runs: @@ -27,11 +27,12 @@ runs: run: | git checkout -b license-update-${{ github.sha }} git commit -m "docs: updating copyright license year" - git push + git push origin license-update-${{ github.sha }}:license-update-${{ github.sha }} || true - 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).' + if [[ $(git log --branches --not --remotes) ]]; 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).' || true + fi env: GH_TOKEN: ${{ github.token }} From a98a012d907c22a38e4c9fec31afd0d60f756b6a Mon Sep 17 00:00:00 2001 From: David Leal Date: Tue, 27 Jun 2023 14:20:32 -0600 Subject: [PATCH 2/3] fix: use proper GitHub branch --- license_copyright/license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/license_copyright/license.yml b/license_copyright/license.yml index 39edca0..46fd3b2 100644 --- a/license_copyright/license.yml +++ b/license_copyright/license.yml @@ -32,7 +32,7 @@ runs: shell: bash run: | if [[ $(git log --branches --not --remotes) ]]; 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).' || true + 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).' || true fi env: GH_TOKEN: ${{ github.token }} From 1587840fe10250e9cf28677fd033b2ed4a361210 Mon Sep 17 00:00:00 2001 From: David Leal Date: Mon, 3 Jul 2023 17:30:34 +0000 Subject: [PATCH 3/3] chore: apply suggestions from code review Co-authored-by: Taj --- license_copyright/license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/license_copyright/license.yml b/license_copyright/license.yml index 46fd3b2..9c56e1f 100644 --- a/license_copyright/license.yml +++ b/license_copyright/license.yml @@ -27,12 +27,12 @@ runs: run: | git checkout -b license-update-${{ github.sha }} git commit -m "docs: updating copyright license year" - git push origin license-update-${{ github.sha }}:license-update-${{ github.sha }} || true + git push origin license-update-${{ github.sha }}:license-update-${{ github.sha }} - name: Creating and merging the PR shell: bash run: | if [[ $(git log --branches --not --remotes) ]]; then - 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).' || true + 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).' fi env: GH_TOKEN: ${{ github.token }}