File tree 2 files changed +56
-0
lines changed
2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ PREV_YEAR=$1
6
+ CURR_YEAR=$2
7
+ DIR=$3
8
+
9
+ OLD_VALUE=" // Copyright (C) 2001-$PREV_YEAR the original author or authors."
10
+ NEW_VALUE=" // Copyright (C) 2001-$CURR_YEAR the original author or authors."
11
+
12
+ find " $DIR " -type f \( -name * .java -o -name * .header -o -name * .g4 \) \
13
+ -exec sed -i " s|$OLD_VALUE |$NEW_VALUE |g" {} +
14
+
15
+ BASEDIR=$( pwd)
16
+ echo " Distinct Diff in $DIR is:"
17
+ cd " $DIR "
18
+ git diff | grep -Eh " ^\+" | grep -v " +++ b" | sort | uniq
19
+ cd " $BASEDIR "
Original file line number Diff line number Diff line change
1
+ # ############################################################################
2
+ # GitHub Action to bump license year
3
+ #
4
+ # Workflow starts every new year.
5
+ #
6
+ # ############################################################################
7
+ name : " Bump license year"
8
+ on :
9
+ schedule :
10
+ - cron : ' 0 12 1 1 *'
11
+ permissions :
12
+ contents : write
13
+ pull-requests : write
14
+ jobs :
15
+ bump :
16
+ name : Bump license year
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - name : Checkout the latest code
20
+ uses : actions/checkout@v2
21
+ with :
22
+ token : ${{ secrets.GITHUB_TOKEN }}
23
+ - name : Set Current Year
24
+ id : CURRENT_YEAR
25
+ run : |
26
+ echo "::set-output name=year::$(date +'%Y')"
27
+ - name : Modify Files
28
+ run : |
29
+ ./.ci/bump-license-year.sh $(expr ${{ env.YEAR }} - 1) ${{ env.YEAR }} .
30
+ env :
31
+ YEAR : ${{ steps.CURRENT_YEAR.outputs.year }}
32
+ - name : Push commit
33
+ run : |
34
+ git config --global user.name 'github-actions[bot]'
35
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
36
+ git commit -am "minor: Bump year to ${{ env.YEAR }}"
37
+ git push
You can’t perform that action at this time.
0 commit comments