https://github.com/endormi/yearplusplus
Simple GitHub action for automating the year change in specified files
https://github.com/endormi/yearplusplus
actions automation github-actions workflow year
Last synced: 3 months ago
JSON representation
Simple GitHub action for automating the year change in specified files
- Host: GitHub
- URL: https://github.com/endormi/yearplusplus
- Owner: endormi
- License: mit
- Created: 2024-04-07T16:38:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-11T07:45:00.000Z (7 months ago)
- Last Synced: 2025-03-11T08:32:39.159Z (7 months ago)
- Topics: actions, automation, github-actions, workflow, year
- Language: YAML
- Homepage: https://github.com/marketplace/actions/yearplusplus
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yearplusplus
GitHub Action to automatically update year in specified files.
## Usage
| Input Name | Description | Required | Default Value |
|-------------|-----------------------------------------|----------|---------------------------|
| `files` | Files to update | Yes | |
| `username` | Username for the commit | No | github-actions[bot] |
| `email` | Email for the commit | No | github-actions[bot] email |
| `commit_message` | Commit message | No | Update copyright year |
| `from_year` | Year to replace (customizable) | No | Last year |
| `to_year` | Year to replace with (customizable)| No | Current year |One of these is required for this Workflow to work (otherwise you get an 403 error):
Option 1: Go to Settings of your repository, then navigate to Actions > General. Under "Workflow permissions," choose Read and write permissions.
Option 2: Create a PAT (Personal Access Token) with the necessary permissions. You can do this in your GitHub account settings. Once created, add the PAT as a secret in your repository settings and use it in your workflow.
## Example
```yaml
name: Update Yearon:
schedule:
- cron: "0 1 1 1 *" # 01:00 on January 1jobs:
update_year:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# You might not need this
# with:
# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # Whichever name you decide to use.- name: Update year in specified files
uses: endormi/yearplusplus@v2
with:
files: 'LICENSE' # Provide the file(s) you want to update
# username: 'Year++' # Optional: specify a username (defaults to 'github-actions[bot]')
# email: '<>' # Optional: specify an email (defaults to 'github-actions[bot]@users.noreply.github.com')
# commit_message: '' # Optional: specify commit message (defaults to 'Update copyright year')
# from_year: '2023' # Optional: specify the year to replace (defaults to last year)
# to_year: '2024' # Optional: specify the year to replace with (defaults to current year)
```## License
The source code is released under the [MIT License](LICENSE).