You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
51 lines
1.6 KiB
name: Update Copyright Year
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 3 1 1 *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Get current year
|
|
id: date
|
|
run: echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Check Out Repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: nightly
|
|
|
|
- name: Update Copyright
|
|
run: sed -i -E 's/(Copyright \(c\) ).+( meisnate12)/\1${{ steps.date.outputs.year }}\2/' LICENSE
|
|
|
|
- name: Check Diff
|
|
id: verify_diff
|
|
run: |
|
|
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit & Push Changes
|
|
if: steps.verify_diff.outputs.changed == 'true'
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add -A
|
|
git commit -m "Copyright updated to ${{ steps.date.outputs.year }}" -a
|
|
git push origin nightly
|
|
|
|
- name: Discord Failure Notification
|
|
uses: Kometa-Team/discord-notifications@master
|
|
if: failure()
|
|
with:
|
|
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
|
|
message: <@&1079153184007790652>
|
|
title: "${{ secrets.REPO_NAME }}: **Copyright Update Failed**"
|
|
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
|
|
color: 14879811
|
|
username: Kobota
|
|
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
|
|
author: GitHub
|
|
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/git.png |