forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.16 KB
/
bump-license-year.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#############################################################################
# GitHub Action to bump license year
#
# Workflow starts every new year.
#
#############################################################################
name: "Bump license year"
on:
workflow_dispatch: null
schedule:
- cron: "0 0 1 1 *"
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
bump:
if: github.repository == 'checkstyle/checkstyle'
name: Bump license year
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
- name: Set Current Year
run: |
echo "YEAR=$(date +'%Y')" >> "$GITHUB_ENV"
- name: Modify Files
run: |
./.ci/bump-license-year.sh $(("${{ env.YEAR }}" - 1)) ${{ env.YEAR }} .
- name: Push commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "minor: Bump year to ${{ env.YEAR }}"
git push