Skip to content

Commit 92ca2d5

Browse files
authored
Create copyright-update.yml (jhipster#1208)
1 parent 4a60d00 commit 92ca2d5

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#
2+
# Copyright 2017-2021 the original author or authors from the JHipster project.
3+
#
4+
# This file is part of the JHipster project, see https://www.jhipster.tech/
5+
# for more information.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
name: Copyright Update
20+
on:
21+
schedule:
22+
- cron: '0 0 31 12 *' # Repeats December 31st every year
23+
jobs:
24+
pipeline:
25+
name: copyright update
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 40
28+
29+
steps:
30+
# Checkout
31+
- uses: actions/checkout@v2
32+
33+
# Update the copyright headers
34+
- name: Find and Replace
35+
run: |
36+
CURRENT_YEAR=$(date +'%Y')
37+
NEW_YEAR=$(($CURRENT_YEAR + 1))
38+
grep -rlZE "Copyright ([0-9]+)-$CURRENT_YEAR" . | xargs -0 sed -i -E "s/Copyright ([0-9]+)-$CURRENT_YEAR/Copyright \1-$NEW_YEAR/g"
39+
40+
# Create PR
41+
- name: Create Pull Request
42+
uses: peter-evans/create-pull-request@v3
43+
with:
44+
commit-message: 'feat: update copyright headers'
45+
author: 'jhipster-bot <[email protected]>'
46+
branch: 'copyright-date-update'
47+
title: 'Update Copyright Headers'
48+
body: 'This is an automated pull request to update the copyright headers'

0 commit comments

Comments
 (0)