Skip to content

Commit d85b8d2

Browse files
authored
Merge pull request #181 from splitio/license-year
added GHA for updating license year
2 parents 80e3c93 + 0fbcacc commit d85b8d2

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Update License Year
2+
3+
on:
4+
schedule:
5+
- cron: "0 3 1 1 *" # 03:00 AM on January 1
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set Current year
21+
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"
22+
23+
- name: Set Previous Year
24+
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"
25+
26+
- name: Update LICENSE
27+
uses: jacobtomlinson/gha-find-replace@v2
28+
with:
29+
find: ${{ env.PREVIOUS }}
30+
replace: ${{ env.CURRENT }}
31+
include: "LICENSE"
32+
regex: false
33+
34+
- name: Commit files
35+
run: |
36+
git config user.name 'github-actions[bot]'
37+
git config user.email 'github-actions[bot]@users.noreply.github.com'
38+
git commit -m "Updated License Year" -a
39+
40+
- name: Create Pull Request
41+
uses: peter-evans/create-pull-request@v3
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
title: Update License Year
45+
branch: update-license

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2021 Split Software, Inc.
1+
Copyright © 2022 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)