Skip to content

Commit 8677b27

Browse files
authored
Merge pull request #249 from splitio/gha/license
added gha for updating license
2 parents a8aac43 + 18dbcac commit 8677b27

File tree

2 files changed

+50
-0
lines changed

2 files changed

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

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'pytest-mock>=3.5.1',
1111
'coverage',
1212
'pytest-cov',
13+
'tomli==1.2.3',
1314
]
1415

1516
INSTALL_REQUIRES = [

0 commit comments

Comments
 (0)