File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1818
1919name : Copyright Update
2020on :
21+ workflow_dispatch :
2122 schedule :
22- - cron : ' 0 0 31 12 *' # Repeats December 31st every year
23+ - cron : ' 0 0 1 1 *' # Repeats January 1st every year
2324
2425permissions :
2526 contents : read
3031 contents : write # for peter-evans/create-pull-request to create branch
3132 pull-requests : write # for peter-evans/create-pull-request to create a PR
3233 name : copyright update
33- if : github.repository == 'jhipster/generator-jhipster'
34+ if : github.repository == 'jhipster/generator-jhipster' || github.event_name == 'workflow_dispatch'
3435 runs-on : ubuntu-latest
35- timeout-minutes : 40
36+ timeout-minutes : 6
3637 steps :
3738 # Checkout
3839 - uses : actions/checkout@v5
4243 # Update the copyright headers
4344 - name : Find and Replace
4445 run : |
45- CURRENT_YEAR=$(date +'%Y')
46- NEW_YEAR=$(($CURRENT_YEAR + 1))
47- grep -rlZE "Copyright ([0-9]+)-$CURRENT_YEAR" . | xargs -0 sed -i -E "s/Copyright ([0-9]+)-$CURRENT_YEAR/Copyright \1-$NEW_YEAR/g"
46+ grep -rlZE "Copyright 20[0-9]{2}" . | xargs -0 sed -i -E "s/Copyright ([0-9]{4})-([0-9]{4})/Copyright \1-$(date +'%Y')/g"
47+ git diff
4848 # Create PR
4949 - name : Create Pull Request
5050 uses : peter-evans/create-pull-request@v7
Original file line number Diff line number Diff line change 3333jobs :
3434 build :
3535 runs-on : ubuntu-latest
36+ if : github.repository == 'jhipster/generator-jhipster'
3637 permissions :
3738 contents : read
3839 packages : write
You can’t perform that action at this time.
0 commit comments