From bce7151d0c28d7818d1bd8b43712bc96ee992e4f Mon Sep 17 00:00:00 2001 From: Vyacheslav Kapitonov Date: Sun, 26 Mar 2023 19:41:09 +0300 Subject: [PATCH] Auto-update LICENSE file every year automatically (#1055) --- .github/workflows/autoupdate-license.yaml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/autoupdate-license.yaml diff --git a/.github/workflows/autoupdate-license.yaml b/.github/workflows/autoupdate-license.yaml new file mode 100644 index 00000000..6c1bdd01 --- /dev/null +++ b/.github/workflows/autoupdate-license.yaml @@ -0,0 +1,25 @@ +name: Update License Year + +on: + schedule: + - cron: '0 0 1 1 *' + +jobs: + update-year: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Update year in license file + run: | + year=$(date +%Y) + sed -i "s/2017-[0-9]*/2017-$year/g" LICENSE + + - name: Set git config + run: | + git config user.name "Automated" + git config user.email "actions@users.noreply.github.com" + git add LICENSE + git commit -m "Update license years" || exit 1 + git push