Plex-Meta-Manager/.github/workflows/copyright.yml

51 lines
1.6 KiB
YAML
Raw Normal View History

2024-04-22 14:57:22 +00:00
name: Update Copyright Year
on:
schedule:
- cron: '0 3 1 1 *'
workflow_dispatch:
jobs:
2024-05-14 20:53:26 +00:00
update-copyright:
2024-04-22 14:57:22 +00:00
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 }}
2024-05-14 20:53:26 +00:00
message: ${{ vars.BUILD_FAILURE_ROLE }}
title: "${{ vars.REPO_NAME }}: ${{ vars.TEXT_COPYRIGHT }}"
2024-04-29 14:49:46 +00:00
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
2024-05-14 20:53:26 +00:00
color: ${{ vars.COLOR_FAILURE }}
username: ${{ vars.BOT_NAME }}
avatar_url: ${{ vars.BOT_IMAGE }}
author: ${{ vars.GIT_NAME }}
author_icon_url: ${{ vars.GIT_IMAGE }}