A simple GitHub Action to automatically update the year in your LICENSE files.
Add this to your workflow file (.github/workflows/update-license.yml):
name: Update License Year
on:
schedule:
- cron: '0 0 1 1 *' # Run every January 1st
workflow_dispatch: # Allow manual trigger
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: nivmizz7/annual-update-license-year@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}- Finds all LICENSE files in your repo
- Replaces all years with the current year
- Commits and pushes changes automatically
That's it! Super simple.
LICENSELICENSE.mdLICENSE.txtCOPYINGCOPYING.md
Copyright (c) 2020
↓
Copyright (c) 2020-2026
Copyright © 2019
↓
Copyright © 2019-2026
Copyright (c) 2020-2024
↓
Copyright (c) 2020-2026
(c) 2020
↓
(c) 2020-2026
MIT License - See LICENSE