-
Notifications
You must be signed in to change notification settings - Fork 70
42 lines (38 loc) · 1.13 KB
/
bump-license-year.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
#############################################################################
# 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