Skip to content

Bump license year

Bump license year #1

#############################################################################
# GitHub Action to bump license year
#
# Workflow starts every new year.
#
#############################################################################
name: "Bump license year"
on:
workflow_dispatch: null
schedule:
- cron: "0 0 1 1 *"
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
bump:
if: github.repository == 'checkstyle/checkstyle'
name: Bump license year
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
- name: Set Current Year
run: |
echo "YEAR=$(date +'%Y')" >> "$GITHUB_ENV"
- name: Modify Files
run: |
./.ci/bump-license-year.sh $(("${{ env.YEAR }}" - 1)) ${{ env.YEAR }} .
- name: Push commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "minor: Bump year to ${{ env.YEAR }}"
git push