Skip to content

Bump license year

Bump license year #3

---
#############################################################################
# GitHub Action to bump license year
#
# Workflow starts every new year.
#
#############################################################################
name: "Bump license year"
on:
schedule:
- cron: '0 8 1 1 *'
permissions:
contents: write
pull-requests: write
jobs:
bump:
name: Bump license year
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set Current Year
id: CURRENT_YEAR
run: |
echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT
- name: Modify Files
run: |
./.ci/bump-license-year.sh $(expr ${{ env.YEAR }} - 1) ${{ env.YEAR }} .
env:
YEAR: ${{ steps.CURRENT_YEAR.outputs.year }}
- name: Push commit
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "minor: Bump year to ${{ env.YEAR }}"
git push